Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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
Android AppBarLaout内部的底部导航视图_Android_Android Appbarlayout_Bottomnavigationview - Fatal编程技术网

Android AppBarLaout内部的底部导航视图

Android AppBarLaout内部的底部导航视图,android,android-appbarlayout,bottomnavigationview,Android,Android Appbarlayout,Bottomnavigationview,我正试图将BottomNavigationView以类似Facebook的滚动行为放置在工具栏上 我能够将BottomNavigationView放在顶部并实现所需的行为。但是,BottomNavigationView有一个我无法消除的高程 这是布局图 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xm

我正试图将BottomNavigationView以类似Facebook的滚动行为放置在工具栏上

我能够将BottomNavigationView放在顶部并实现所需的行为。但是,BottomNavigationView有一个我无法消除的高程

这是布局图

<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar_new_main"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:descendantFocusability="beforeDescendants"
        android:focusableInTouchMode="true"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/searchable_toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways"
            app:titleTextColor="@android:color/white"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

        <android.support.design.widget.BottomNavigationView
            android:id="@+id/navigation"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="?attr/colorPrimary"
            app:itemTextColor="@color/white"
            app:itemIconTint="@color/white"
            app:menu="@menu/activity_main_bottom_nav_menu"/>

    </android.support.design.widget.AppBarLayout>

    <FrameLayout
        android:id="@+id/content"
        android:background="@color/activity_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <TextView
            android:id="@+id/message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/activity_vertical_margin"
            android:layout_marginLeft="@dimen/activity_horizontal_margin"
             android:layout_marginRight="@dimen/activity_horizontal_margin"
            android:layout_marginTop="@dimen/activity_vertical_margin"
            android:text="@string/title_home" />

    </FrameLayout>

</android.support.design.widget.CoordinatorLayout>

有人知道问题出在哪里吗?
谢谢

如果您想删除底部导航视图上的高程,请添加此应用程序:elevation=“0dp”


尝试使用
app:elevation=“0dp”
您的
BottomNavigationView
属性删除高程
BottomNavigationView
,如下面的示例代码所示

<android.support.design.widget.BottomNavigationView
      android:id="@+id/navigation"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="?attr/colorPrimary"
      app:itemTextColor="@color/white"
      app:elevation="0dp"
      app:itemIconTint="@color/white"
      app:menu="@menu/activity_main_bottom_nav_menu"/>


谢谢@Mohit Suthar,但我在写这篇文章之前试过了,没有成功。在工具栏中添加这个app:elevation=“0dp”,显示工具栏阴影可能再次出现。非常感谢。好的,我知道问题出在哪里了。我将android:elevation=“0dp”替换为app:elevation=“0dp”。谢谢@Nilesh。我不会检查答案是否正确,因为默希特·苏塔尔是第一个。很抱歉,但我真的很感激。@user274051不用担心,很乐意帮助您
<android.support.design.widget.BottomNavigationView
      android:id="@+id/navigation"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="?attr/colorPrimary"
      app:itemTextColor="@color/white"
      app:elevation="0dp"
      app:itemIconTint="@color/white"
      app:menu="@menu/activity_main_bottom_nav_menu"/>