ptg7068951
360 HOUR 24:Writing Android Apps
The editing window includes a Palette pane with several folders that can
be expanded. The Form Widgets subpane, which is likely to be expanded,
displays some simple widgets that can be dragged and dropped onto the
screen at right.
Follow these steps to add three graphical buttons to the screen:
- Delete the textview widget that displays the “Hello World” text.
Click this widget on the screen and press Delete. - Double-click the Images & Mediafolder in the Palette pane. The sub-
pane expands. - Drag an ImageButton widget from the Palette to the screen. Anarrow
blue box appears on the screen and an error message appears below
the screen. The error is flagged because the button lacks an image—
don’t worry about it. - Drag two more ImageButton widgets to the screen. They will be
stacked vertically. - An Outline pane lists the widgets on the screen. Select the
imageButton1 item. The properties of the button open in the
Properties pane (see Figure 24.14).
Set Horizontal Orientation
ImageButtonwidget ScreenScreen
FIGURE 24.13
Editing the app’s
AndroidManifest.xmlfile.