1

Привет, ребята У меня проблема с NavigationBarView. Я установил NavigationBarView, чтобы это не произошло, и я установил другой вид выше NavigationBarView. Я сделал это Activity с Tranculents Style. Но у меня есть ошибка, панель уведомлений двойная, это нарисовано сверху NavigationBarView.Панель уведомлений двойного назначения на верхней панели навигации View Android

Это мой XML:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.ad.sample.ui.activity.HomeActivity"> 
    <fragment 
     android:id="@+id/map" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true"> 
    </fragment> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical"> 
     <View 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignTop="@+id/btn_main_menu" 
      android:layout_alignBottom="@+id/navigation_view" 
      android:background="@color/biru" 
      android:layout_alignParentTop="true" 
      android:clickable="true" 
      android:soundEffectsEnabled="false" /> 

     <android.support.design.widget.NavigationView 
      android:paddingLeft="8dp" 
      android:id="@+id/navigation_view" 
      android:layout_below="@+id/btn_main_menu" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/biru" 
      app:itemTextColor="@color/white" 
      app:menu="@menu/main_menu" /> 
     <android.support.design.widget.FloatingActionButton 
      android:id="@+id/btn_main_menu" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="10dp" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:layout_marginTop="@dimen/marginTopToolbar" 
      app:backgroundTint="@color/white" 
      app:elevation="1dp" /> 
    </RelativeLayout> 
</FrameLayout> 

И этот стиль-v21

<style name="AppTheme.HomeActivity"> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
     <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
     <item name="android:windowTranslucentStatus">true</item> 
    </style> 

Как это исправить?

enter image description here

ответ

0

Попробуйте это: - код работает нормально в моем случае, похоже, проблемы двойной панели уведомлений из-за какой-то другой причине. Но я исправил ваш код.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.ad.sample.ui.activity.HomeActivity"> 
    <fragment 
     android:id="@+id/map" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true"> 
    </fragment> 

    <RelativeLayout 

     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     > 
     <View 
      android:layout_width="wrap_content" 
      android:layout_height="1dp" 
      android:layout_above="@+id/btn_main_menu" 
      android:background="@color/blue" 
      android:clickable="true" 
      android:soundEffectsEnabled="false" /> 

     <android.support.design.widget.NavigationView 
      android:paddingLeft="8dp" 
      android:id="@+id/navigation_view" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/blue" 
      app:itemTextColor="@color/white" 
      app:menu="@menu/main_menu" 
      android:layout_alignParentBottom="true" 
      /> 
     <android.support.design.widget.FloatingActionButton 
      android:id="@+id/btn_main_menu" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginBottom="10dp" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:layout_marginTop="10dp" 
      app:backgroundTint="@color/white" 
      app:elevation="1dp" 
      android:layout_above="@+id/navigation_view"/> 
    </RelativeLayout> 
</FrameLayout> 
+0

Stiil Не работает :( –

Смежные вопросы