I have these two buttons in my program, one has a good fat margin of blue around, the other one however doesn't. The words are right on the border of the button, how can I add some margin?
The word you are looking for is padding
. In your Android xml add the padding
property for the button. Something like
android:padding="10dp"
You can adjust the number and see whatever suits you.
Use padding for both button. Like this
android:padding="10dp"
Try it.
Add padding value for the right button like this
android:paddingLeft="12dp"
android:paddingRight="12dp"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.