有一个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上面了
view.bringToFront() 可以讲布局在下层的控件放到上层,不被其他控件挡住。 我是搬运工 : http://blog.csdn.net/flyfight88/article/details/8669831