O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

More on XML Layout Attributes

Let’s go back over some of the attributes you added in fragment_crime.xml and answer some lingering questions you might have about widgets and attributes.

Styles, themes, and theme attributes

A style is an XML resource that contains attributes that describe how a widget should look and behave. For example, the following is a style resource that configures a widget with a larger-than-normal text size.

 ​ ​<​s​t​y​l​e​ ​n​a​m​e​=​"​B​i​g​T​e​x​t​S​t​y​l​e​"​>​
 ​ ​ ​ ​<​i​t​e​m​ ​n​a​m​e​=​"​a​n​d​r​o​i​d​:​t​e​x​t​S​i​z​e​"​>​2​0​s​p​<​/​i​t​e​m​>​
 ​ ​ ​ ​<​i​t​e​m​ ​n​a​m​e​=​"​a​n​d​r​o​i​d​:​l​a​y​o​u​t​_​m​a​r​g​i​n​"​>​3​d​p​<​/​i​t​e​m​>​
 ​ ​<​/​s​t​y​l​e​>​

You can create your own styles (and you will in

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required