I have a button like so...

Sorry if it looks dark but as you can see, I have set the height and width to wrap content but the scaletype is not fitxy so there is still "button excess" if you will.
Is there any way to remove this?
You can used ImageButton. Do it in your xml
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButtonSettings"
android:src="@drawable/tabbar_icon"
android:background="@android:color/transparent"/>
or programmatically. this is the simple only you have to set background color as transparent
ImageButton btn=(ImageButton)findViewById(R.id.ImageButton01);
btn.setBackgroundColor(Color.TRANSPARENT);
use an ImageButton and set the background of it to transparent like this : android:background="@android:color/transparent"
<ImageButton
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:src="@drawable/btn_login" />
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