2017-01-13 5 views
4

Ich versuche, Navigation Schublade in meiner Anwendung zu bauen, Navigation Schublade funktioniert gut in der früheren Version von Nougat, aber in Nougat Navigation Schublade kommt nicht über die Statusleiste. Ich habe viele Lösungen ausprobiert, aber arbeite nicht in Nougat bitte helfen !!Navigationsschublade über Statusleiste im Nougat?

das ist mein activity_main.xml Datei:

<android.support.v4.widget.DrawerLayout 
     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:id="@+id/drawerLayoutId" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <RelativeLayout 
     android:fitsSystemWindows="true"  
     android:id="@+id/activity_main" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 

     tools:context="com.example.pushpam.helloworld.MainActivity"> 

     <include 
      layout="@layout/custom_tool_bar" 
      android:id="@+id/customtollbarimportid"/> 

     <TextView 
      android:textSize="80dp" 
      android:textColor="#E9CC0014" 
      android:text="I" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/customtollbarimportid" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentStart="true" 
      android:layout_marginLeft="65dp" 
      android:layout_marginStart="65dp" 
      android:layout_marginTop="79dp" 
      android:id="@+id/textView" /> 

     <TextView 

      android:textSize="80dp" 
      android:textColor="#E9CC0014" 
      android:text="Love" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/textView2" 
      android:layout_centerVertical="true" 
      android:layout_centerHorizontal="true" /> 

     </RelativeLayout> 

    <fragment 
     android:fitsSystemWindows="true" 
     android:id="@+id/nav_drawer_fragment_id" 
     android:layout_width="280dp" 
     android:layout_height="match_parent" 
     app:layout="@layout/fragment_navigationfragment" 
     android:layout_gravity="start" 
     android:name="com.example.pushpam.helloworld.navigationfragment" 
     tools:layout="@layout/fragment_navigationfragment" /> 

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

mein styles.xml:

<!-- Base application theme. --> 
<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> 

<style name="CustomToolBarTheme"> 

    <item name="android:textColorPrimary">@color/toolBarTextColor</item> 
    <item name="android:textColorSecondary">@color/toolBarTextColor</item> 
    <item name="windowActionBar">false</item> 
    <item name="windowNoTitle">true</item> 
</style> 

und Styles (v21) .xml

<resources> 

    <style name="CustomToolBarTheme"> 
     <item name="android:textColorPrimary">@color/toolBarTextColor</item> 
     <item name="android:textColorSecondary">@color/toolBarTextColor</item> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
     <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
     <item name="android:statusBarColor">@android:color/transparent</item> 
     <item name="android:windowTranslucentStatus">true</item> 
    </style> 
</resources> 

my current navigation drawer

dies ist meine aktuelle Navigationsleiste i über die Statusleiste möge.

+0

Post ein Bild von Ihrem Status –

+0

@Charuka siehe –

+0

haben Sie eine Farbe hinzufügen deine Statusleiste? Schublade ist hinter dem ich denke, –

Antwort

6

Sie haben eine farbige Statusleiste. So ist die Navigationsleiste dahinter nicht sichtbar. Machen Sie Ihre Statusleiste transparent und dann wird es dort sein.

http://blog.raffaeu.com/archive/2015/04/11/android-and-the-transparent-status-bar.aspx

<!-- Make the status bar traslucent --> 
<style name="AppTheme" parent="AppTheme.Base"> 
    <item name="android:windowTranslucentStatus">true</item> // add this item tag inside your Theme Styles.xml and Styles(v21).xml: 
</style> 
+0

@xyz rety hast du es richtig gemacht? –

+0

noting geändert nach dem Hinzufügen von windowTranslucentStatus –

+0

@xyz haty wo haben Sie hinzugefügt? Sie müssen es auf das richtige Thema hinzufügen, das ist Ihr App-Thema, das Sie in Ihrem Menifest finden, auch in den Stilen (v21) .xml, kopieren Sie nicht den Lochblock nur erhalten Sie das Tag und fügen Sie es in das richtige Thema, dass Sie verwenden –

Verwandte Themen