[英]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.