簡體   English   中英

如何在android xml visualizer的父垂直線性布局中包含子水平線性布局?

[英]How can i include a child horizontal linear layout in a parent vertical linear layout in android xml visualizer?

在下面提供的圖像中,子級水平布局(黃色)僅覆蓋屏幕的一半,而另一半則呈栗色(父級垂直布局的顏色)。如何使水平布局覆蓋整個第二半部分?

圖片 >

這是你想要的嗎? 您的問題不清楚。 在此處輸入圖片說明

這就是你想要的。

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="2">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/background_dark"
        android:layout_weight="1">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/holo_orange_light"
            android:text="Demo Text" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        android:layout_weight="1"
        android:background="@color/red">

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/desiredone"/>

    </LinearLayout>

</LinearLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM