tags:

views:

22

answers:

1

As the title says, I cannot get padding around the text.

Here's my xml:

<style name="StandardButton" parent="@android:style/Widget.Button">
    <item name="android:background">@drawable/nine_patch_3</item>
    <item name="android:textColor">@color/white</item>
    <item name="android:textStyle">bold</item>
    <item name="android:paddingLeft">10dp</item>
    <item name="android:paddingRight">10dp</item>
</style>

Thanks!

+1  A: 

You can specify paddings through the 9-patch image itself. Draw lines along right and bottom borders of the image. Paddings then will be equal to the size of the lines minus size of the stretch lines (drawn on the left and bottom borders).

Second option: try using 'dip' units instead of 'dp' in your style definition.

Konstantin Burov
Strangely enough, changing to 'dip' helped, although the documentation says you can use both. Hmph. Thanks, Kon!
Allen Gingrich