2017-05-13 10 views
1

동작 모드에서 Toolbar의 스타일을 수정하는 방법을 얻을 수 없습니다.동작 모드에서 도구 모음의 스타일을 수정할 수 없음

<!-- DialogWhenLarge uses to show Activity as Dialog on the tablet --> 
    <style name="Theme.Paper.DialogWhenLarge" parent="Theme.AppCompat.Light.DialogWhenLarge"> 
     <item name="colorPrimary">@color/primary</item> 
     <item name="colorPrimaryDark">@color/primary_dark</item> 
     <item name="colorAccent">@color/accent</item> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
     <item name="windowActionModeOverlay">true</item> 
     <item name="actionBarTheme">@style/Theme.Paper.Toolbar</item> 
     <item name="actionBarPopupTheme">@style/Theme.Paper.Toolbar.PopupOverlay</item> 
     <!-- Below attributes available on the v11+ only --> 
     <item name="android:windowCloseOnTouchOutside">false</item> 
    </style> 

    <style name="Theme.Paper.Toolbar" parent="Theme.Paper"> 
     <item name="android:background">@color/primary</item> 
     <item name="android:textColorPrimary">@color/white</item> 
     <item name="android:textColorSecondary">@color/white</item> 
     <item name="colorControlNormal">@color/white</item> 
     <item name="colorControlHighlight">@color/accent</item> 
     <item name="colorControlActivated">@color/white</item> 
     <item name="actionMenuTextColor">@color/white</item> 
     <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item> 
    </style> 

    <style name="Theme.Paper.Toolbar.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> 
     <item name="colorPrimary">@color/primary</item> 
     <item name="colorPrimaryDark">@color/primary_dark</item> 
     <item name="android:textColorPrimary">@color/black_87</item> 
     <item name="android:textColorSecondary">@color/black_54</item> 
     <item name="android:colorBackground">@color/white</item> 
     <item name="colorControlHighlight">@color/black_30</item> 
     <item name="colorControlActivated">@color/white</item> 
     <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item> 
    </style> 

내 문제는 무엇입니까? 그리고 나는 무엇을 얻고 싶습니까? 나는 그것을 아래에 게시했다.

올바른 도구 모음의 스타일은 내가
Correct toolbar style
이 필요하지만 동작 모드에서 너무 (흰색 행동과 원색 배경과 흰색 텍스트 메뉴)
Wrong toolbar style
P.S.을 보이는 것입니다 나는 그것을 고치려고했지만 잘못된 스타일을 얻을 때마다.

답변

0

나는 잘 모르지만 ... 누군가는 똑같은 문제를 겪을 것입니다. 따라서 저에게 적합한 솔루션 아래 :

<resources> 
    <!-- 
    * 
    * App themes 
    * 
    --> 
    <!-- DialogWhenLarge uses to show Activity as Dialog on the tablet --> 
    <style name="Theme.Paper.DialogWhenLarge" parent="Theme.AppCompat.Light.DialogWhenLarge"> 
     <item name="colorPrimary">@color/primary</item> 
     <item name="colorPrimaryDark">@color/primary_dark</item> 
     <item name="colorAccent">@color/accent</item> 
     <item name="windowActionBar">false</item> 
     <item name="windowNoTitle">true</item> 
     <item name="windowActionModeOverlay">true</item> 
     <item name="actionBarPopupTheme">@style/Theme.Paper.Toolbar.PopupOverlay</item> 
     <item name="actionModeStyle">@style/Theme.Paper.ActionMode</item> 
     <!-- Below attributes available on the v11+ only --> 
     <item name="android:windowCloseOnTouchOutside">false</item> 
    </style> 
    <!-- 
    * 
    * ActionBar, AppBarLayout and Toolbar styles 
    * 
    --> 
    <!-- Action mode --> 
    <style name="Theme.Paper.ActionMode" parent="Widget.AppCompat.ActionMode"> 
     <item name="background">@color/primary</item> 
    </style> 
    <!-- Toolbar --> 
    <style name="Theme.Paper.Toolbar" parent="Theme.Paper"> 
     <item name="android:background">@color/primary</item> 
     <item name="android:textColorPrimary">@color/white</item> 
     <item name="android:textColorSecondary">@color/white</item> 
     <item name="colorControlNormal">@color/white</item> 
     <item name="colorControlHighlight">@color/accent</item> 
     <item name="colorControlActivated">@color/white</item> 
     <item name="actionMenuTextColor">@color/white</item> 
     <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item> 
    </style> 
    <!-- Toolbar popup overlay --> 
    <style name="Theme.Paper.Toolbar.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"> 
     <item name="colorPrimary">@color/primary</item> 
     <item name="colorPrimaryDark">@color/primary_dark</item> 
     <item name="android:textColorPrimary">@color/black_87</item> 
     <item name="android:textColorSecondary">@color/black_54</item> 
     <item name="android:colorBackground">@color/white</item> 
     <item name="colorControlHighlight">@color/black_30</item> 
     <item name="colorControlActivated">@color/white</item> 
     <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item> 
    </style> 

</resources>