Roman Fedoruk
Roman Fedoruk

Reputation: 7

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?

Here

Upvotes: 0

Views: 58

Answers (3)

BaDo
BaDo

Reputation: 578

Add padding value for the right button like this

android:paddingLeft="12dp"
android:paddingRight="12dp"

Upvotes: 0

Phương Trần
Phương Trần

Reputation: 1

Use padding for both button. Like this

android:padding="10dp"

Try it.

Upvotes: 0

Antrromet
Antrromet

Reputation: 15414

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.

Upvotes: 1

Related Questions