Android table-like layout suggestion -
i have create tricky layout in picture below.
each square imageview. idea regardless of screen size or resolution layout contains "1,2,3,4 , 5" fills parent width , maintains configuration image above ("4" should below , between "1" , "2", "5" below , between "2" , "3").
i have tried using 2 linear layouts "weight" specified, tried using "grid layout", "table layout" no luck - if initial configuration right, won't retain on different screen sizes.
can me 1 please? how achieve layout picture?
try layout.this may not perfect solution,but hope idea :)
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> <imageview android:id="@+id/imageview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> <imageview android:id="@+id/imageview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > <imageview android:id="@+id/imageview4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> <imageview android:id="@+id/imageview5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_launcher" /> </linearlayout> </linearlayout>
Comments
Post a Comment