繁体   English   中英

Android片段XML布局问题

[英]Android fragment XML layout issue

我正在尝试实现虽然相当合理的片段布局,但是我遇到了一些问题。 谁能大致建议以下布局的XML解决方案(我知道现在已经支持嵌套片段,但如果可能的话,我想避免这种情况):

“ ============================”
| 111111111111111111 | 333333333 |
| 111111111111111111 | 333333333 |
| 111111111111111111 | 333333333 |
| 111111111111111111 | 333333333 |
| 111111111111111111 | 333333333 |
| 111111111111111111 | 333333333 |
| ================= | 333333333 |
| 222222222222222222 | 333333333 |
| 222222222222222222 | 333333333 |
“ ============================”

这确实是一个简单的布局。

这是你想要的?

在此处输入图片说明

代码如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" >

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="#ff0000" >
        </FrameLayout>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="2"
            android:background="#00ff00" >
        </FrameLayout>
    </LinearLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="2"
        android:background="#0000ff" >
    </FrameLayout>

</LinearLayout>

暂无
暂无

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

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