8.4.5. textview_border.xml
The style ContactTextView
that you created in the preceding section defines the appearance of the TextView
s that are used to display a contact’s details. You specified a Drawable
(i.e., an image or graphic) named @drawable/textview_border
as the value for the TextView
’s android:background
attribute. In this section, you’ll define that Drawable
in the app’s res/drawable-mdpi
folder. If a Drawable
is defined in only one of the project’s drawable
folders, Android will use that Drawable
on all device sizes and resolutions. To define the Drawable
:
1. Right click the res/drawable-mdpi
folder and select New > Android XML File.
2. Specify textview_border.xml
as the File name and select shape as the root element, then click ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.