I have three LinearLayout inside a LinearLayout
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:id="@+id/l1"
android:layout_alignParentTop="true"></LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:id="@+id/l2"
android:layout_alignParentTop="true"></LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:id="@+id/l3"
android:layout_alignParentTop="true"></LinearLayout>
</LinearLayout>
And I'm putting a ImageButton
inside each of the layout as well
if(l==1){
layout1.addView(btCategoria);
layout1.addView(txtCategoria);
Log.e("l1","entrou "+txtCategoria.getText());
l=2;
}else if(l==2){
layout2.addView(btCategoria);
layout2.addView(txtCategoria);
Log.e("l2","entrou "+txtCategoria.getText());
l=3;
}else if(l==3){
layout3.addView(btCategoria);
layout3.addView(txtCategoria);
Log.e("l3","entrou "+txtCategoria.getText());
l=1;
}
btCategoria
and ImageButton
and txtCategoria
and TextView
plus the first one is not staying on the same line as the rest
Iwantedtoknowwhythefirstimageisabovetheothersnext
Withthisgridviewwillworkmoreithasthisandroid:columnWidth="200dp"
, wanted to know if you can not define it because if you put a specific size will get bad depending on the cell phone né.
<GridView
android:id="@+id/grid"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_below="@+id/spinner_widget"
android:cacheColorHint="@color/abc_search_url_text_holo"
android:columnWidth="200dp"
android:gravity="center"
android:numColumns="3"
android:stretchMode="spacingWidth" />