我想要构建一个像这样的UI http://postimg.org/image/fihidv1rv/。 这里是我的XML代码吧, 为我的设计,我想“效果” &“CAMERA”合并为一个ImageView
像在链接 “SHOP”所以会有总共5 ImageView
秒,我设置的ID因为他们在链接中命名为Android,如何在relativelayout中设置带有百分比的imageview
问题是,我如何设置高度和宽度的百分比?
效果+ camrea:高度25%,宽度100%
拼贴:高度25%,宽度50%
拉伸:高度25%,宽度50%
照片:高度50% ,宽50%
店:高25%,宽度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"
android:layout_below="@+id/img_draw"
android:src="@drawable/d" />
<ImageView
android:id="@+id/img_shop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/img_photo"
android:src="@drawable/e" />
</RelativeLayout>
你要使用的布局重量 – Sandy09
请检查你的问题。总高度高达125%。将拼贴,绘制和照片在同一行?总比例为150%。 – Ethan
这不是真的125%和150%,因为它们按特殊顺序排列,它显示在此链接http://postimg.org/image/fihidv1rv/ – Kennett