繁体   English   中英

将视图置于两个具有严格尺寸的视图之间

[英]Put view between two Views with strict size

有什么办法可以将我的FrameLayout放在1.1和1.3之间。 我尝试使用layout_belowlayout_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_weightLinearLayout将首先对具有固定尺寸的视图进行布局,然后将所有剩余空间分配给layout_weight="1"视图。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM