开发者

Android design layouts comparison

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 )?


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.


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 !!!


If you use mostly Linearlayout it will be helpful as you can use same app for different screen size in Landscape as well as Potrait mode.I use only Linearlayout in layout so my design looks same when orientation changed for all screen sizes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜