布局全部

我有这个按钮,该按钮显示在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>
hanyujing 回答:布局全部

请阅读以下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>

我希望它对您有用。

本文链接:https://www.f2er.com/2989453.html

大家都在问