Modify Existing Theme
I would like to know if it is possible (and how) to customize an existing theme. What I'm looking for is how can I retrieve a certain attribute (i.e. color) and change it when the
Solution 1:
Why not just make your own theme, setting the android:parent
to the theme you want to copy, then set your own attributes? That is demonstrated in this documentation, like so:
<?xml version="1.0" encoding="utf-8"?><resources><stylename="CodeFont"parent="@android:style/TextAppearance.Medium"><itemname="android:layout_width">fill_parent</item><itemname="android:layout_height">wrap_content</item><itemname="android:textColor">#00FF00</item><itemname="android:typeface">monospace</item></style></resources>
In this case, the CodeFont
style will be identical to the TextAppearance.Medium
style, except for the item
s specified here. You can do the same with any theme, including the default Holo or Dark theme or whatnot.
Post a Comment for "Modify Existing Theme"