0

Meine App enthält Schublade und andere Fragmente. Fragmente legen die Symbolleiste für Aktivität fest. Warum Schubladensymbol nicht weiß? Ich verwende ein weißes Thema für jede App. Wenn Call SyncState vom Fragment-Schubladensymbol jedoch schwarz ist. Wenn ich die Symbolleiste in das Aktivitätslayout verlagere, ist alles in Ordnung. Warum?Warum Schubladensymbol nicht weiß?

Entschuldigung für mein Englisch.

enter image description here

Aktivität Layout:

<?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/drawer_layout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true"> 


<FrameLayout 
    android:id="@+id/content_frame" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 


<android.support.design.widget.NavigationView 
    android:id="@+id/nav_view" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:layout_gravity="start" 
    app:headerLayout="@layout/app_nav_header_main" 
    app:menu="@menu/main_drawer" /> 

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

Fragment Layout:

<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/flipper" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical"> 

<include 
    layout="@layout/layout_please_wait" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 

<android.support.design.widget.CoordinatorLayout 
    android:id="@+id/coordinator" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/appBarLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:fitsSystemWindows="true" 
     android:theme="@style/AppTheme.AppBarOverlay" 
     app:elevation="0dp"> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      android:background="?attr/colorPrimary" 
      android:elevation="0dp" 
      app:layout_collapseMode="pin" 
      app:layout_scrollFlags="scroll|enterAlways" 
      app:popupTheme="@style/AppTheme.PopupOverlay" /> 

     <android.support.design.widget.TabLayout 
      android:id="@+id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="?attr/colorPrimary" 
      android:elevation="0dp" 
      android:minHeight="?attr/actionBarSize" 
      android:theme="@style/AppTheme.AppBarOverlay" 
      app:tabIndicatorColor="@android:color/white" /> 
    </android.support.design.widget.AppBarLayout> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/pager" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/addAds" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom|right" 
     android:src="@drawable/ic_action_new" 
     app:layout_anchor="@id/pager" 
     app:layout_anchorGravity="bottom|right|end" 
     app:layout_behavior="sakh.com.utils.ScrollAwareFABBehavior" 
     app:useCompatPadding="true" /> 

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

<include 
    layout="@layout/layout_no_internet" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 
</ViewFlipper> 

Fragment Code:

@Override 
public void onActivityCreated(Bundle savedInstanceState) { 
    super.onActivityCreated(savedInstanceState); 

    ((BaseActivity) getActivity()).setSupportActionBar(mToolbar); 
    ((BaseActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
    ((BaseActivity) getActivity()).getSupportActionBar().setHomeButtonEnabled(true); 
    ((BaseActivity) getActivity()).getDrawerToggle().syncState(); 
    ......... 
    ......... 
} 
+0

versuchen, diese App: itemIconTint = "# ffffff" –

Antwort

0

Ihre AppTheme.AppBarOverlay sollte

wie dies ein Kind dunkles Thema sein:

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

+0

Ja, es ist