ptg7068951
Designing a Real App 361
- Scroll down theProperties pane until you see an ID property. Its
value currently is set to @+id/imageButton1. Change this to
@+id/phonebutton. - Scroll down to the Src property, which currently equals
drawable/icon. Click this value. An ellipse (...) button appears. - Click the ... button. AReference Chooser dialog opens.
- Expand the Drawable heading to see a list of the app’s graphics,
which are the resources you added earlier. Choose phoneand click
OK. The button now has a graphic of a phone.
10.In the On Click property, enter the value processClicks. (This is
explained in the next section.)
11.Repeat steps 5–10 for imageButton2, giving it the ID @+id/webbutton
and the Src drawable/browser.
12.Repeat steps 5–10 for imageButton3, giving it the ID @+id/mapbutton
and the Src drawable/maps.
13.Click the Set Horizontal Orientation button above the screen (refer to
Figure 24.13). The buttons now are lined up side by side.
14.Click the LinearLayout item in the Outline. The properties for the
screen appear in the Properties pane.
15.Click the value for Background, and then click the ... button. The
Reference Chooser opens.
ImageButton1
ID value
FIGURE 24.14
Customizing a widget’s properties.