底部栏跌至导航栏后面的低处

底部栏跌至导航栏后面的低处

本文介绍了底部栏跌至导航栏后面的低处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

底部导航隐藏在设备按钮的后面,请参见下图:

Bottom navigation hide behind device buttons see below image :

我不能使用任何scrollview视图或任何其他内容.

I can't use any scrollview view or anything.

请参阅以下我的活动代码:

See below code of my activity:

<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:openDrawer="start"
    android:background="@color/offwhite"
    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.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/nav_menu"
        />


    <RelativeLayout
        android:layout_below="@+id/nav_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
        <FrameLayout
            android:id="@+id/nav_Frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:layout_above="@+id/bottom_navigation"
            >
        </FrameLayout>

        <LinearLayout
            android:id="@+id/bottom_navigation"
            android:layout_width="match_parent"
            android:layout_height="@dimen/_40sdp"
            android:background="@color/white"
            android:layout_alignParentBottom="true"
            >

            <ImageView
                android:id="@+id/iv_home"
                android:layout_width="@dimen/_20sdp"
                android:layout_height="@dimen/_20sdp"
                android:src="@drawable/ic_myaccount"
                android:tint="@color/light_gray"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                />

            <ImageView
                android:id="@+id/iv_notification"
                android:layout_width="@dimen/_20sdp"
                android:layout_height="@dimen/_20sdp"
                android:src="@drawable/ic_myaccount"
                android:tint="@color/light_gray"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                />

            <ImageView
                android:id="@+id/iv_add"
                android:layout_width="@dimen/_20sdp"
                android:layout_height="@dimen/_20sdp"
                android:src="@drawable/ic_myaccount"
                android:tint="@color/light_gray"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                />

            <ImageView
                android:id="@+id/iv_massage"
                android:layout_width="@dimen/_20sdp"
                android:layout_height="@dimen/_20sdp"
                android:src="@drawable/ic_myaccount"
                android:tint="@color/light_gray"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                />

            <ImageView
                android:id="@+id/iv_account"
                android:layout_width="@dimen/_20sdp"
                android:layout_height="@dimen/_20sdp"
                android:src="@drawable/ic_myaccount"
                android:tint="@color/light_gray"
                android:layout_gravity="center_vertical"
                android:layout_weight="1"
                />

        </LinearLayout>


    </RelativeLayout>
</android.support.v4.widget.DrawerLayout>

style.xml代码:

 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

推荐答案

我对此进行了搜索,最后我明白了为什么该底部导航显示在底部栏下

I search about this and finally i got it why this bottom navigation show under the bottom bar

我在Java类中的Flag下方删除.

i remove below Flag in my Java class.

getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

我添加了此标志,以将ActionbarStatusbar混合使用.

I added this flag for mix up the Actionbar and Statusbar.

因此,我只删除了该标志,它看起来很完美. :)

So I just remove this flag and it's look perfect. :)

这篇关于底部栏跌至导航栏后面的低处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 12:50