android:paddingLeft="50dp" android:paddingTop="70dp" Once you are done playing with the property, undo any changes and padding recover the screen to the state as shown in Figure 14. layout:height Back to the screen in Figure 13, keeping the selected, LinearLayout (Horizontal) look for and properties in the pane, change layout:width layout:height Properties their value to "wrap_content". What did you see? The has been LinearLayout adjusted to just fitting the two buttons as shown in Figure 18. Figure 18: Just Fitting Learning 4: The and properties of the allow you to layout:width layout:height LinearLayout set the width and height of the layout. You can specify width and height with exact measurements in (density-independent pixels) but more often than not, you will dp use one of these constants to set the width or height, namely "fill_parent", "match_parent", or "wrap_content". Note that has been deprecated fill_parent starting from API Level 8 and is replaced by match_parent. The constant will stretch the layout to fit its match_parent parent entirely (minus the padding, if any), e.g. the screen, whereas GridView the will size the layout to fit its entire child wrap_content Views. The and attributes in the android:layout_width android:layout_height <LinearLayout> node in the would have been modified as "activity_main.xml" shown. Switch to view and look for them. Text android:layout_width="wrap_content" android:layout_height="wrap_content" Once you are done here, undo any changes and recover the screen to the state as shown in Figure 14. Orientation
android:paddingLeft="50dp" android:paddingTop="70dp" Once you are done playing with the padding property, undo any changes and recover the screen to the state as shown in Figure 14. layout:height Back to the screen in Figure 13, keeping the LinearLayout (Horizontal) selected, look for layout:width and layout:height properties in the Properties pane, change their value to "wrap_content". What did you see? The LinearLayout has been adjusted to just fitting the two buttons as shown in Figure 18. Figure 18: Just Fitting Learning 4: The layout:width and layout:height properties of the LinearLayout allow you to set the width and height of the layout. You can specify width and height with exact measurements in dp (density-independent pixels) but more often than not, you will use one of these constants to set the width or height, namely "fill_parent", "match_parent", or "wrap_content". Note that fill_parent has been deprecated starting from API Level 8 and is replaced by match_parent. The match_parent constant will stretch the layout to fit its parent GridView entirely (minus the padding, if any), e.g. the screen, whereas the wrap_content will size the layout to fit its entire child Views. The android:layout_width and android:layout_height attributes in the <LinearLayout> node in the "activity_main.xml" would have been modified as shown. Switch to Text view and look for them. android:layout_width="wrap_content" android:layout_height="wrap_content" Once you are done here, undo any changes and recover the screen to the state as shown in Figure 14. Orientation
Android%20UI%20and%20Controls%20New.docx