Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GridView or TableLayout?

http://img683.imageshack.us/img683/645/weatherscreenmockupoutl.png

I am asking myself whats the best way to code this layout. Basicly i just need to know how to get seven columns with an equal width.

Thanks in advance!

like image 758
timoschloesser Avatar asked Oct 25 '11 07:10

timoschloesser


2 Answers

if it is the equal width that you want, you can go for linearLayout with children of equal weight. check out the following xml.

<LinearLayout
    layout:orientation="horizontal"
>
    <LinearLayout
      android:id = "@+id/firstcolumn"
      android:layout_weight="1"
      android:orientation="vertical"
      android:layout_width="0dp"
    >
    // do the same for your rest of the six children

</LinearLayout>
like image 101
Yashwanth Kumar Avatar answered Sep 20 '22 21:09

Yashwanth Kumar


TableLayout seems better, because the number of columns won't change. With GridView you have to add adapters and stuff.

like image 35
Reno Avatar answered Sep 21 '22 21:09

Reno