O'Reilly logo

Android UI Design by Jessica Thornsby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exploring different layouts

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 RelativeLayout layout.

Everything you need to know about LinearLayout

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 LinearLayout layout is only ever one row high.
  • android:orientation="vertical.": The views are placed below each other in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required