其他分享
首页 > 其他分享> > 动作栏Sherlock Dark主题与Light Theme Dark Action Bar

动作栏Sherlock Dark主题与Light Theme Dark Action Bar

作者:互联网

我正在使用Action Bar Sherlock,我想知道是否有一种方法可以使Action Bar Dark主题(Theme.Sherlock)使用与Light Dark Action Bar主题相同的Action Bar(Theme.Sherlock.Light.DarkActionBar) .

目前,这些是我的样式,但是深色主题仍然使用深色动作栏.

<style name="AppTheme.Light" parent="Theme.Sherlock.Light.DarkActionBar" />

<style name="AppTheme.Dark" parent="Theme.Sherlock">
    <item name="windowContentOverlay">@drawable/abs__ab_solid_shadow_holo</item>
    <item name="actionBarStyle">@style/Widget.Sherlock.Light.ActionBar.Solid.Inverse</item>
    <item name="actionBarWidgetTheme">@style/Theme.Sherlock</item>

    <item name="actionDropDownStyle">@style/Widget.Sherlock.Spinner.DropDown.ActionBar</item>
    <item name="actionButtonStyle">@style/Widget.Sherlock.ActionButton</item>
    <item name="actionOverflowButtonStyle">@style/Widget.Sherlock.ActionButton.Overflow</item>
    <item name="actionModeBackground">@drawable/abs__cab_background_top_holo_dark</item>
    <item name="actionModeSplitBackground">@drawable/abs__cab_background_bottom_holo_dark</item>
    <item name="actionModeCloseDrawable">@drawable/abs__ic_cab_done_holo_dark</item>
    <item name="homeAsUpIndicator">@drawable/abs__ic_ab_back_holo_dark</item>
    <item name="actionBarTabStyle">@style/Widget.Sherlock.Light.ActionBar.TabView.Inverse</item>
    <item name="actionBarTabBarStyle">@style/Widget.Sherlock.Light.ActionBar.TabBar.Inverse</item>
    <item name="actionBarTabTextStyle">@style/Widget.Sherlock.Light.ActionBar.TabText.Inverse</item>
    <item name="actionBarDivider">@drawable/abs__list_divider_holo_dark</item>
    <item name="actionBarItemBackground">@drawable/abs__item_background_holo_dark</item>
    <item name="actionMenuTextColor">?attr/textColorPrimaryInverse</item>
    <item name="actionModeStyle">@style/Widget.Sherlock.Light.ActionMode.Inverse</item>
    <item name="actionModeCloseButtonStyle">@style/Widget.Sherlock.ActionButton.CloseMode</item>
    <item name="actionModePopupWindowStyle">@style/Widget.Sherlock.PopupWindow.ActionMode</item>

    <item name="actionModeShareDrawable">@drawable/abs__ic_menu_share_holo_dark</item>
</style>

我从Action Bar Sherlock源代码复制了所有样式项.

解决方法:

我也正尝试这样做,找到了解决方案here

The easiest way to convey exactly what this entails is with an
example. The following is the full theme from the “Styled” example
mentioned above:

<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar">
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
    <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
</style>

<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="background">@drawable/bg_striped</item>
    <item name="android:background">@drawable/bg_striped</item>

    <item name="backgroundSplit">@drawable/bg_striped_split</item>
    <item name="android:backgroundSplit">@drawable/bg_striped_split</item>
</style>

标签:themes,actionbarsherlock,android
来源: https://codeday.me/bug/20191201/2077351.html