Friday, 15 July 2011

Changing Styles

An example of overriding Styles in the styles.xml:

We adjust the default TextAppearance and the Button styles:


</resources>
    <style name="info_text_small" parent="@android:style/TextAppearance.Small">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_alignParentLeft">true</item>
        <item name="android:typeface">serif</item>
        <item name="android:textColor">#FFFFFF</item>
    </style>

    <style name="bus_button" parent="@android:style/Widget.Button.Small">
        <item name="android:typeface">serif</item>
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:layout_weight">0.5</item>
        <item name="android:minWidth">60sp</item>
        <item name="android:minHeight">50sp</item>
    </style>
</resources>

No comments:

Post a comment