简体   繁体   中英

How can I add a bigger margin around my button?

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM