How do I change the theme on an Android application? -
i'm developing android application , want change color , theme of application. how can this?
dev guide explains how apply themes , styles.
this:
<textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:textcolor="#00ff00" android:typeface="monospace" android:text="@string/hello" />
becomes this:
<textview style="@style/codefont" android:text="@string/hello" />
by defining xml theme file:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="codefont" parent="@android:style/textappearance.medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textcolor">#00ff00</item> <item name="android:typeface">monospace</item> </style> </resources>
you can apply styles activities of application:
<application android:theme="@style/customtheme">
or 1 activity:
<activity android:theme="@android:style/theme.dialog">
Comments
Post a Comment