![](/img/trans.png)
[英]how to create two fixed size views and one view spanned between them in android?
[英]Put view between two Views with strict size
有什么办法可以将我的FrameLayout
放在1.1和1.3之间。 我尝试使用layout_below
和layout_above
,但无法同时使用。
1. RelativeLayout
1.1 RelativeLayout
(strict_size)
1.2 FrameLayout
(match_parent)
1.3 RelativeLayout
(strict_size)
我会使用LinearLayout
。 假设您在谈论高度:
<LinearLayout
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="20dp">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="20dp">
</LinearLayout>
像这样使用layout_weight
, LinearLayout
将首先对具有固定尺寸的视图进行布局,然后将所有剩余空间分配给layout_weight="1"
视图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.