Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the border behind the button?

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" /> 
like image 200
Al Phaba Avatar asked Jan 18 '13 09:01

Al Phaba


People also ask

How do you hide the outline of a button?

Show activity on this post. So use border: none; and that annoying blue border shall disappear!

How do I remove the button focus outline?

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.


2 Answers

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"/> 
like image 140
MaxExplode Avatar answered Sep 22 '22 09:09

MaxExplode


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" /> 
like image 44
throrin19 Avatar answered Sep 26 '22 09:09

throrin19