第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

元素在LinearLayout中的位置

元素在LinearLayout中的位置

qq_笑_17 2021-05-14 18:04:18
我有個問題。在LinearLayout中是否可以有兩個元素,一個在另一個上?這是我實際的XML LinearLayout。實際上,我有一個LinearLayout,其中包含元素列表(RecyclerView)和一個簡單的“打開”按鈕:<LinearLayout    android:id="@+id/linearbox"    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:orientation="vertical">    <!-- Start RecyclerView -->    <android.support.v7.widget.RecyclerView        android:id="@+id/recyclerview"        android:layout_width="match_parent"        android:layout_height="match_parent"        android:layout_gravity="center_horizontal" />    <!-- Include Open Button -->    <include layout="@layout/open_button" /></LinearLayout>我想在我的元素列表上添加一個View,我已經完成了布局。我現(xiàn)在只想將其包括在我的列表中:<include layout="@layout/open_button" />謝謝
查看完整描述

1 回答

?
尚方寶劍之說

TA貢獻1788條經驗 獲得超4個贊

正如Avijit Karmakar所建議的那樣,您不能使用LinearLayout來做到這一點,您將不得不使用FrameLayout,

因為它最適合您想要在一個視圖之上實現(xiàn)另一種視圖的需求。只需將您的根布局更改為FrameLayout


<FrameLayout

            android:id="@+id/linearbox"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:orientation="vertical">


                <!-- Start RecyclerView -->

                <android.support.v7.widget.RecyclerView

                    android:id="@+id/recyclerview"

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_gravity="center_horizontal" />


            <!-- Include Open Button -->

            <include layout="@layout/open_button" />

        </FrameLayout>


查看完整回答
反對 回復 2021-05-26
  • 1 回答
  • 0 關注
  • 213 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號