Creating Layouts
We'll cover the following...
We’ll use two layouts in this app, one for the main landing page and the other for each of the rows to display airport status information. Let’s start with the design of the first one.
Designing initial layout
In the Project pane, under app/res/layout
, you’ll see the file activity_main.xml
—it was created by the IDE when the project was created. Double click this file name and take a look at the layout. You can view and edit the layout using the Design view, or directly view and edit the XML document using the Text view. Let’s edit the layout from the Design view.
The Android Studio provides powerful ways to add various widgets to the layout. Start by deleting the TextView
with the words Hello World
from the middle of the layout. Then from the Text section under the Palette, drag and drop a TextView
onto the layout. On the right pane, change the text
value for the newly placed widget from TextView
to Airport Code
. In the right pane, above the text box that you changed, take note of a rectangle with four + symbols around it.
Click the top + and change ...