I did it using 3 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_marginRight="2dp"
android:layout_weight="1"
android:gravity="start"
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="start"
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_marginLeft="2dp"
android:layout_weight="1"
android:gravity="start"
android:id="@+id/l3"
android:layout_alignParentTop="true"></LinearLayout>
</LinearLayout>
But then I divided only in 3 the screen of the cell phone , if the mobile is bigger the image gets bigger if the screen is smaller. The way the L1,L2,L3 is it divides the screen into 3 each LinearLayout
is the same size as the other. I put the images per line of code
Why don’t you use a Listview?
– ramaral
But as I would add X images to each item in the list, being that X is not an exact number, it will depend on the size of the device’s resolution. X would be the amount of image the device would support horizontally.
– Pertile
I think I understand now: you want to put a number
x
of horizontal images where this number depends on the resolution, the remaining images move to the next line. Right? Then use a Gridview– ramaral
I’ll give a read on gridview I haven’t used it yet, thanks for the help.
– Pertile