问题描述
- framelayout显示在最上层
-
有一个id为listLayout的框架布局,包含一个button。需要这个框架布局显示在其他id为news_fragment 的框架之上。<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/listLayout" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content"> <Button android:id="@+id/lists" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:background="@drawable/btn_black_xml" android:padding="8dp" android:text="List" android:textColor="#ffffff" android:textSize="20dp" /> </FrameLayout> <FrameLayout android:id="@+id/news_fragment" android:layout_weight="2" android:layout_width="0dp" android:layout_height="match_parent"> </FrameLayout> <FrameLayout android:id="@+id/channel_fragment" android:layout_weight="3" android:layout_width="0dp" android:layout_height="match_parent" /> </LinearLayout>
请高手帮忙实现。谢谢
解决方案
两个layout外面套一个framelayout不就是
解决方案二:
listLayout和newsLayout写在同一个frameLayout中 listLayout写在newsLayout后面就在newsLayout上面了
时间: 2024-07-29 15:09:04