Goran
Goran

Reputation: 1239

Android textview options in custom dialog

I created custom dialog and i have textview in it. Text is pretty close to edge of my dialog box, so i wonder if I can set some space between my text and left and right edge of dialog box and how ??

Upvotes: 0

Views: 207

Answers (2)

zeiger
zeiger

Reputation: 700

You need to create your TextView with some marginLeft and marginRight attributes. These will put some space between your TextView and the left, right edges of the screen.

Also consider using paddingLeft, paddingRight attributes to ensure that there is some space between the border of your TextView and the actual text itself.

Look here for more information about how you can set these parameters in a TextView.

Upvotes: 0

Benito Bertoli
Benito Bertoli

Reputation: 25793

In your custom dialog's xml layout add the following to the root:

android:padding="10dp"

Or whichever value you see fit.

Upvotes: 1

Related Questions