Figure 30: Dropped a Button control Check out "the in the view (Figure 31). activity_relative_layout.xml" Text Figure 31: LinearLayout with one Button Controls You will notice that the has been assigned a new attribute TextView android:id as shown: android:id="@+id/textView2" and the new <Button> node has the following attributes referencing the "Hello through its attribute. These attributes determine world!" TextView android:id the position of this button in relation to the TextView. android:layout_below="@+id/textView2" android:layout_toRightOf="@+id/textView2" android:layout_toEndOf="@+id/textView2" The actual distances are determined by the following margins: android:layout_marginLeft="23dp" android:layout_marginTop="48dp" In the view, drag and drop a second control from the Design Button Widgets (Figures 32 and 33) towards the bottom of the screen. When the Palette button is nearing the edge of the screen, a dialog box pops up updating you with information about the respective margins for aligning to the right and bottom of the parent i.e. the (Figure 32). ViewGroup, RelativeLayout
Figure 30: Dropped a Button control Check out "the activity_relative_layout.xml" in the Text view (Figure 31). Figure 31: LinearLayout with one Button Controls You will notice that the TextView has been assigned a new android:id attribute as shown: android:id="@+id/textView2" and the new <Button> node has the following attributes referencing the "Hello world!" TextView through its android:id attribute. These attributes determine the position of this button in relation to the TextView. android:layout_below="@+id/textView2" android:layout_toRightOf="@+id/textView2" android:layout_toEndOf="@+id/textView2" The actual distances are determined by the following margins: android:layout_marginLeft="23dp" android:layout_marginTop="48dp" In the Design view, drag and drop a second Button control from the Widgets Palette (Figures 32 and 33) towards the bottom of the screen. When the button is nearing the edge of the screen, a dialog box pops up updating you with information about the respective margins for aligning to the right and bottom of the parent ViewGroup, i.e. the RelativeLayout (Figure 32).
Android%20UI%20and%20Controls%20New.docx