将布局置于所有位置
Put layout over all
我有这个,按钮出现在 loadingView 上,如何获得全屏加载视图?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/btnRemove"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/btnRemove"/>
<!-- Loading View -->
<include
layout="@layout/loading_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
请阅读本github期:[Android] Can't Overlap a Button with any view #3543
要将加载视图重叠到全屏,请尝试以下代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<Button
android:id="@+id/btnRemove"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:text="Button"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/btnRemove"/>
</RelativeLayout>
<include
layout="@layout/loading_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
希望对你有用。
我有这个,按钮出现在 loadingView 上,如何获得全屏加载视图?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/btnRemove"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/btnRemove"/>
<!-- Loading View -->
<include
layout="@layout/loading_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
请阅读本github期:[Android] Can't Overlap a Button with any view #3543
要将加载视图重叠到全屏,请尝试以下代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<Button
android:id="@+id/btnRemove"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:text="Button"/>
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/btnRemove"/>
</RelativeLayout>
<include
layout="@layout/loading_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
希望对你有用。