-1
data1    hello   hi 
data2    hello2  hi
data3    hi      Hello

I want to konw what should be use,TableLayout?linearLayout or RelativeLayout?Which view realize the layout will more better?I also want to use XML code realize this layout,ask you for help,thank you!

suannai
  • 552
  • 1
  • 4
  • 17

2 Answers2

0

IT all depends entrely upon the GUI you want to design, how you want to place your GUI obejcts. The Android official site has a very informative and helpful tutorial on this topic:

http://developer.android.com/guide/topics/ui/declaring-layout.html

http://developer.android.com/guide/topics/ui/declaring-layout.html#CommonLayouts

Muhammad Maqsoodur Rehman
  • 33,681
  • 34
  • 84
  • 124
0

Do you need anything to move around ? Interact with any of the objects?

If you just want something that simple, you can use the TableLayout. If you only need to support ICS (Android 4.0) and later, you can also checkout GridLayout.

LinearLayout is probably not your best choice in terms of performance (will do a lot of calculations for not much). If you have a lot of elements in your table, RelativeLayout is not best either.

You can also check this answer about TableLayout from a Google employee.

Community
  • 1
  • 1
Matthieu
  • 16,103
  • 10
  • 59
  • 86