ImageButton
が固定サイズになるのを防ぐにはどうすればよいですか?セレクターで使用されるドローアブルのサイズが異なるためImageButton
、画像サイズに合わせてサイズを変更したいと思います。
私はadjustViewBounds
成功せずに試しました。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp" >
<ImageButton
android:id="@+id/picture_imagebutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="@drawable/tab_background_selector" />
</RelativeLayout>