- #1
whitehorsey
- 192
- 0
I'm using linear layout to make two so that I can insert up to 6 images. For example, if I have one image it will fit in the center of that layout if I have two it will divide the space equally for the two images, etc.
So far I have this,
<LinearLayout
android:id="@+id/row1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/space"
androidrientation="vertical" >
<LinearLayout
android:id="@+id/row2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="17dp"
android:layout_marginLeft="60dp"
androidrientation="vertical" >
</LinearLayout>
</LinearLayout>
I used two vertical linear layouts to make the rows. How do I tell the images to fit the box if there's one, to split equally if there's two, etc.?
I'm placing the linear layout (rows) in the biggest box (first column second box).
So far I have this,
<LinearLayout
android:id="@+id/row1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/space"
androidrientation="vertical" >
<LinearLayout
android:id="@+id/row2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="17dp"
android:layout_marginLeft="60dp"
androidrientation="vertical" >
</LinearLayout>
</LinearLayout>
I used two vertical linear layouts to make the rows. How do I tell the images to fit the box if there's one, to split equally if there's two, etc.?
I'm placing the linear layout (rows) in the biggest box (first column second box).