Thursday, February 23, 2012

Android User Interface, Common Layout Objects


The more common types of layout objects to use in android applications are as follows:

  • Frame Layout.
  • Linear Layout.
  • Table Layout.
  • Relative Layout.

Frame Layout:

  • Frame Layout is a blank space on the screen that we can later fill with a single object.
  • All child elements of the Frame Layout are pinned to the top left corner of the screen, cannot specify a location for a child views.
  • Later child views will simply be drawn over earlier ones.
Linear Layout:

  • Linear Layout  aligns all children in a single direction — vertically or horizontally, depending on how you define the orientation attribute.
  • All children are stacked one after the other, so a vertical list will only have one child per row, no matter how wide they are, and a horizontal list will only be one row high (the height of the tallest child, plus padding).
Table Layout:

  • Table Layout positions its children into rows and columns.
  • TableLayout containers do not display border lines for their rows, columns, or cells. The table will have as many columns as the row with the most cells.
  • A table can leave cells empty, but cells cannot span columns, as they can in HTML.

Relative Layout:

  • Relative Layout lets child views specify their position relative to the parent view or to each other (specified by ID). So you can align two elements by right border, or make one below another, centered in the screen, centered left, and so on.
Some other Important View Groups:

  • Gallery
  • GridView
  • ListView
  • ScrollView
  • Spinner




    No comments:

    Post a Comment