RelativeLayout

The RelativeLayout class is arguably the most powerful layout that Android provides. It's a relative layout, managing widgets of varying sizes, and aligning widgets against each other instead of against their parent or grid-lines. In some ways, RelativeLayout has a striking resemblance to the Swing GroupLayout class, although it is nowhere near as complex. Each widget in a RelativeLayout is positioned against either another widget, or against its parent (the RelativeLayout itself).

RelativeLayout calculates the location of each child in a single loop, so it relies strongly on the order in which you specify the children. However, this doesn't mean that you must specify the widgets in the order they are displayed on the screen. Due ...

Get Android User Interface Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.