Android Layout With Images And Compatibility
I develop a photo album app. I would like to place photos on screen like the following layout : For this purpose, I decided to place a vertical linear layout at outside of all. Th
Solution 1:
Use linear layout completely and make sure you know what layout_weight does. refer the following
http://developer.android.com/guide/topics/ui/declaring-layout.html#CommonLayouts
http://developer.android.com/guide/topics/ui/layout/linear.html#Weight
Solution 2:
Try this...its only for 1 row, but you get the idea..this is inside vertical linear layout..
<LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_height="wrap_content" ><ImageViewandroid:id="@+id/imageView1"android:layout_width="0dp"android:layout_weight="1"android:src="@drawable/ic_launcher"android:layout_height="wrap_content" /><LinearLayoutandroid:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"android:orientation="vertical"
><ImageViewandroid:id="@+id/imageView2"android:layout_width="wrap_content"android:layout_height="1dp"android:src="@drawable/ic_launcher"android:layout_weight="1"android:layout_gravity="center_horizontal"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="1dp"android:layout_weight="1" ><ImageViewandroid:id="@+id/imageView3"android:layout_width="0dp"android:layout_weight="1"android:src="@drawable/ic_launcher"android:layout_height="wrap_content" /><ImageViewandroid:id="@+id/imageView4"android:layout_width="0dp"android:layout_weight="1"android:src="@drawable/ic_launcher"android:layout_height="wrap_content" /></LinearLayout></LinearLayout></LinearLayout>
Post a Comment for "Android Layout With Images And Compatibility"