27
I want to build a UI like this http://postimg.cc/image/fihidv1rv/ .
Here is my xml code for it,
for my design, I want "EFFECT" & "CAMERA" to combine as one ImageView like "SHOP" in the link
so there will be total 5 ImageViews, and I set the id as they named in the link
the problem is, how can I set the height and width with percentage?
effect+camrea: height 25%,width 100%
collage: height 25%,width 50%
draw: height 25%,width 50%
photo: height 50%,width 50%
shop: height 25%,width 100%
<RelativeLayout android:id="@+id/mainContent" android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="horizontal" android:background="#ffffff">
<ImageView
android:id="@+id/img_effect+camera"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:src="@drawable/a" />
<ImageView
android:id="@+id/img_collage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/img_effect+camera"
android:src="@drawable/b" />
<ImageView
android:id="@+id/img_draw"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/img_effect+camera"
android:layout_toRightOf="@+id/img_collage"
android:src="@drawable/c" />
<ImageView
android:id="@+id/img_photo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/img_collage"