0
ImageButtonビューでイメージを読み込むためにグライドを使用しています。ボタンをクリックするとカメラが開き、撮った写真がボタンに表示されます。 私はちょっと奇妙な問題に直面しています。撮影したすべての写真で、ボタンの画像が大きくなります。ImageButtonが大きくなっています
考えてみませんか?
いくつかのコードが役立つかもしれない:
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_weight="1" >
<ImageButton
android:background="?android:colorBackground"
android:id="@+id/button1_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_menu_camera" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textStyle="bold"
android:gravity="center_horizontal"
android:text="Button1"/>
</LinearLayout>
編集:ここでは
は画像
// I use this to update the ImageButton
RequestManager glide = Glide.with(this);
glide.clear(mLeftTopImageButton);
glide.load(file.getAbsolutePath()).into(mLeftTopImageButton);
を
ありがとう、
大きな方法?高さ、幅、またはその両方? 'ImageView'はもっと大きくなったり、ちょうどイメージになったりしますか? –
イメージのサイズに基づいて、ImageButtonのサイズを増減します。したがって、一貫したイメージを見せたい場合は、ImageButtonの寸法を修正してみてください。 – Prasad
幅は既に 'LinearLayout'の重みで固定されていますか? 問題を示す2つのスクリーンショットを追加します。 –