Fleeting Images
Android has two widgets to help you embed images in your activities: and . As the names suggest, they are image‑based analogues to and , respectively.
Each widget takes an attribute (in an XML layout) to specify what picture to use. These usually reference a drawable resource, described in greater detail in the chapter on resources. You can also set the image content based on a from a content provider via .
, a subclass of , mixes in the Button behaviors, for responding to clicks and whatnot.
For example, take a peek at the layout from the sample project which is found along with all other code samples at http://apress.com:
The result, just using the code‑generated activity, is shown in Figure 6‑2.
Figure 6‑2. The ImageViewDemo sample application
Дата добавления: 2015-05-16; просмотров: 787;