There is a grey border behind my app button, how can I remove this?
I defined the ImageButton
like this:
<ImageButton android:id="@+id/btn_photo_lib" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="startPhotoLibAction" android:src="@drawable/library_blau_2" />
Show activity on this post. So use border: none; and that annoying blue border shall disappear!
To remove focus around the button outline:none property is used. Outline property: Outline is an element property which draws a line around element but outside the border. It does not take space from the width of an element like border.
You have to use style="?android:attr/borderlessButtonStyle"
:
<ImageButton android:id="@+id/btn_photo_lib" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="startPhotoLibAction" android:src="@drawable/library_blau_2" style="?android:attr/borderlessButtonStyle"/>
try this :
<ImageButton android:id="@+id/btn_photo_lib" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="startPhotoLibAction" android:background="@android:color/transparent" android:src="@drawable/library_blau_2" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With