【问题标题】:Android - Navigation Bar replace my Bottom Navigation BarAndroid - 导航栏替换我的底部导航栏
【发布时间】:2017-06-12 16:02:08
【问题描述】:

问题出在标题中,我使用底部导航视图/栏,它在没有虚拟导航栏的智能手机上运行良好:

On my Samsung Galaxy S6 Edge without Navigation Bar

使用虚拟导航栏,底部导航视图消失:

On my Huawei with virtual Navigation Bar

我试图移除导航栏并强制应用程序进入全屏模式并出现底部导航视图/栏。

这就是我认为导航底部栏被智能手机导航栏覆盖的原因。

我希望我的导航底部栏位于虚拟导航栏上方! 请帮我修复这个错误。

编辑: 这是此活动的布局:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawerlayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/ic_fond_opacite"
    android:fitsSystemWindows="false">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <FrameLayout
            android:id="@+id/frame"
            android:layout_above="@+id/bottomNavigationAvis"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

        <com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView
            android:id="@+id/bottomNavigationAvis"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            app:bnv_active_color="@color/vraiment_pro_vert"
            app:itemBackground="@color/vraiment_pro_fond_gris"
            app:itemTextColor="@color/vraiment_pro_fond_gris"
            app:bnv_active_text_size="@dimen/bottom_navigation_text_size_active"
            app:bnv_colored_background="true"
            app:bnv_inactive_text_size="@dimen/bottom_navigation_text_size_inactive"
            app:bnv_with_text="true" />
    </RelativeLayout>



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

【问题讨论】:

  • 你能分享一下你本期的排版文件吗
  • @AmitBhandari 我将布局添加到主帖

标签: android bottomnavigationview android-navigation-bar


【解决方案1】:

我解决了!不幸的是,我的代码中的某些东西阻塞了 UI,这是一个问题,抱歉 :)

【讨论】:

    【解决方案2】:

    尝试将RelativeLayout 的高度设置为match_parent,如下所示。

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
    </RelativeLayout>
    

    【讨论】:

    • 它不会改变任何东西:(
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-07
    • 1970-01-01
    相关资源
    最近更新 更多