I add a button on Android I want to put the image in the center and put a schedule padding.
<Button
android:background="@drawble/~"
/>
I did it like this and it was full. ㅜ<
<Button
android:drawableTop="@drawable/~"
/>
This goes up and...TT
I wish I could be in the center! Masters, please tell us!
android button image padding
If the parent layout is RelativeLayout
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:paddingStart="10dp"
android:src="@drawable/image"
android:background="@android:color/transparent" />
If the parent layout is LinearLayout or FrameLayout, then
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingStart="10dp"
android:src="@drawable/download"
android:background="@android:color/transparent" />
I think we can do it like this.
using and src imagebutton drawable want want the Set, padding scaletype and allocation of inserted into it.~
And if you care about the background, assign it to @null~
© 2024 OneMinuteCode. All rights reserved.