Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android design layouts comparison

Tags:

android

layout

I would like to know pros/cons between the different Android design layouts. In some cases I feel I could choose between linear layout or table layout, or some times between linear layout and Relative layout. I would like to know the following

  • which layout is best in which case
  • which is fast to draw, ect
  • which one is best in performance

Could someone please provide a comparison between the layouts ( Linear, relative, absolute, table, frame etc )?

like image 885
Ijaz Ahmed Avatar asked May 28 '11 14:05

Ijaz Ahmed


2 Answers

The names of the layouts are quite descriptive: you will use a LinearLayoutwhen you want a linear line of views, a table when you want a table, etc.

When you have complicated layouts, RelativeLayoutis the preferred choice.

All of them will drawn in a relatively similar time. What you need to try to avoid is to create too many nested layouts (e.g., LinearLayoutinside LinearLayout).

Take some time an watch this video: Romain Guy's Google I/O 2009 talk. Lots of information to get from there about layout efficiency.

like image 190
Aleadam Avatar answered Oct 03 '22 19:10

Aleadam


This is great link for your answer. http://www.learn-android.com/2010/01/05/android-layout-tutorial/

Relative layout is best as its easy to manage controls on UI. but if you want data in tabular format then table layout is great. I hope it helps !!!

like image 40
Sandip Lawate Avatar answered Oct 03 '22 19:10

Sandip Lawate