Android Android Studio プログラミング
ImageButtonの背景を透明にする(色がつかないようにする)【Android Studio】
レイアウトでImageButton設定。
だが表示のさいに画像を少しはみ出したグレーの背景が表示される。
これはhtmlでリンクを設定する際に画像に枠のような色が付くことに似ている。
場合によってはこの背景があると困るので、背景を無しに設定する。
1 2 3 4 5 6 7 8 |
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/hikari" android:id="@+id/hikari_button" android:layout_marginTop="180dp" android:layout_marginLeft="240dp" android:background="@null" /> |
この中の
1 |
android:background="@null" |
これで背景がなくなる。