Now that you know how to create layouts in XML and Java, and how to set their height and width, you can take a closer look at two of the most commonly used layouts: the straightforward and easy-to-use
LinearLayout layout and the incredibly flexible
LinearLayout aligns all its children in a single horizontal or vertical row, stacking them one after the other.
You set the direction of your
LinearLayout layout using either of the following:
android:orientation="horizontal.": The views are placed next to each other in rows. A horizontal
LinearLayoutlayout is only ever one row high.
android:orientation="vertical.": The views are placed below each other in ...