"Styles and Themes"
A- style is a collection of properties, that specify, the look and format for a View
or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that's separate from the XML that specifies the layout.
A theme is a style applied to an entire Activity
or application, rather than an individual (as in the View
example above). When a style was applied as a theme, every View in the Activity or application would apply each style property that it Suppo Rts.
To create a set of styles, save an XML file in the res/values/
directory of your project. The name of the XML file is arbitrary, but it must use the .xml
extension and being saved in the res/values/
folder.
The root node of the XML file must be <resources>
.
Each child <resources>
of the element was converted into a application resource object at Compile-time, which can referenced By the value in the <style>
element ' s name
attribute. This example style can is referenced from an XML layout as@style/CodeFont
If you are want to inherit from styles and you've defined yourself, you don't have the parent
. Instead, just prefix the name of the the style you want to inherit to the name of the your new style, separated by a period. For example, to create a new style this inherits the CodeFont
style defined above, but make the color red, you can author the New style like this:
Reference: http://www.android-doc.com/guide/topics/ui/themes.html
Styles and Themes