Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
BottomNavigationView在我的应用程序(Android studio java)的底部隐藏部分屏幕_Java_Android Studio_Bottomnavigationview - Fatal编程技术网

BottomNavigationView在我的应用程序(Android studio java)的底部隐藏部分屏幕

BottomNavigationView在我的应用程序(Android studio java)的底部隐藏部分屏幕,java,android-studio,bottomnavigationview,Java,Android Studio,Bottomnavigationview,BottomNavigationView隐藏屏幕后面的部分视图 如何在页脚上方显示视图(底部导航视图) 我已经编辑了以下内容并更新了mainactivity.xml文件 另外,我添加了另一个xml的xml文件,如下所示 我的一个xml <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln

BottomNavigationView隐藏屏幕后面的部分视图

如何在页脚上方显示视图(底部导航视图)

我已经编辑了以下内容并更新了mainactivity.xml文件

另外,我添加了另一个xml的xml文件,如下所示

我的一个xml

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/refresh_layout"
    android:layout_width="match_parent"
    app:layout_constraintBottom_toTopOf="@id/bottom_navigation"
    android:layout_height="match_parent"

    android:background="@color/colorPrimary"
    tools:ignore="NotSibling,RtlHardcoded">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@null">
/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

/>
mainactivity.xml


使用顶部根视图并将其设置为
app:layout\u constraintBottom\u toTopOf=“@id/bottomNavigationView”


使用并设置对上根视图的约束,如
应用程序:layout\u constraintBottom\u toTopOf=“@id/bottomNavigationView”



我有一个主活动,页脚仅在主活动中。您是否提到需要在此主活动屏幕中添加的constraintlayout?我的意思是,无论您使用何种布局来显示底部导航上方的数据,只需添加应用程序:layout_constraintBottom_toTopOf=“@id/bottomNavigationView”高于不worked@sejn您可以共享您的XML吗?在my mainactivity.XML中,我添加了如上所述的内容,在我添加的每个XML中也添加了如上所述的内容。我有一个mainactivity,页脚仅在main activity中。您是否提到需要在此主活动屏幕中添加的constraintlayout?我的意思是,无论您使用何种布局来显示底部导航上方的数据,只需添加应用程序:layout_constraintBottom_toTopOf=“@id/bottomNavigationView”高于不worked@sejn您可以共享您的XML吗?在my mainactivity.XML中,我添加了如上所述的内容,在每个XML中也添加了如上所述的内容。
    <androidx.drawerlayout.widget.DrawerLayout
        android:id="@+id/root_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        android:background="@null"
        tools:ignore="NotSibling,UnknownId">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@null">

            <FrameLayout
                android:id="@+id/fragment_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@null"
                android:paddingBottom="?attr/actionBarSize"
                android:paddingTop="?attr/actionBarSize"/>

          
            <View
                android:id="@+id/divider_toolbar"
                android:layout_width="match_parent"
                android:layout_height="@dimen/stroke"
                android:layout_marginTop="?attr/actionBarSize"
                android:background="@color/colorPrimary"/>
            <FrameLayout
                android:id="@+id/footer_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
                <com.google.android.material.bottomnavigation.BottomNavigationView
                    android:layout_gravity="bottom"
                    android:background="@drawable/curved_shape_footer"
                    android:id="@+id/bottom_navigation"
                    android:layout_width="match_parent"
                    app:itemBackground="?selectableItemBackgroundBorderless"
                    app:itemHorizontalTranslationEnabled="false"
                    app:menu="@menu/bottom_navigation"
                    app:labelVisibilityMode="unlabeled"
                    android:layout_alignParentBottom="true"
                    android:layout_height="wrap_content"/>
            </FrameLayout>
</...>
</...>
</...>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/refresh_layout"
    android:layout_width="match_parent"
    android:layout_height="0dp"      
    android:background="@color/colorPrimary"
    tools:ignore="NotSibling,RtlHardcoded"
     app:layout_constraintTop_toTopOf="parent" 
    app:layout_constraintBottom_toTopOf="@id/bottom_navigation">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@null">

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

<com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottomNavigationView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/bottom_nav_menu" />

</androidx.constraintlayout.widget.ConstraintLayout>