August 2017
Beginner to intermediate
220 pages
4h 50m
English
Graphical properties, such as background color, text size, and elevation, can all be set individually on any UI component. It often makes sense to group properties together into a style. Android stores such styles in the values directory as XML in the styles.xml file. An example of this is as follows:
<?xml version="1.0" encoding="utf-8"?> <resources> <style name="TextStyle" parent="TextAppearance.AppCompat"> <item name="android:textColor">#8000</item> <item name="android:textSize">48sp</item> </style> </resources>
Styles, such as this, can be applied to views and widgets simply and without having to specify each property, as follows:
<TextView . . . android:textAppearance="@style/TextStyle" . . . />
It is quite possible ...
Read now
Unlock full access