O'Reilly logo

Java for Android, Second Edition by Budi Kurniawan

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

Chapter 33

Styles and Themes

The look and feel of an application are governed by the styles and themes it is using. This chapter discusses these two important topics and shows you how to use them.

Overview

A view declaration in a layout file can have attributes, many of which are style-related, including textColor, textSize, background, and textAppearance.

Style-related attributes for an application can be lumped in a group and the group can be given a name and moved to a styles.xml file. A styles.xml file that is saved in the res/values directory will be recognized by the application as a styles file and the styles in the file can be used to style the views in the application. To apply a style to a view, use the style attribute. The ...

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