i have this code for displaying an image on a button.
How to position the image so that it doesn't touch the frame/border?
this the code:
<Button
android:layout_width="0dp"
android:layout_weight="0.45"
android:onClick="EXIT"
android:layout_height="95dp"
android:text="Exit"
android:textSize="22sp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:background="@drawable/buttonnew"
android:textStyle="bold"
android:drawableTop="@drawable/zexit"
android:textColor="#000000"
android:layout_gravity="bottom"
/>
Since you are referring to the Button rather than the drawable, it would be best to use padding instead of margin, e.g. android:paddingTop
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments