【问题标题】:Styling my app with custom colors使用自定义颜色设计我的应用程序
【发布时间】:2023-04-03 22:35:01
【问题描述】:

我正在尝试将一些样式应用于我的应用程序。我使用actionbarstylegenerator 为 ActionBar 创建了一个自定义主题。

但我也想在我的应用程序中将原来的蓝色 Holo 颜色更改为红色,至少在按钮上。

所以,我有 ActionBar (Compat) 的自定义主题,而另一方面,我有一个自定义主题来更改 Holo 颜色。

在我的应用程序中,我已经为Actionbar定义了自定义主题,我想在Actionbar的主题中设置自定义Holo主题,但是我不知道如何调用,或者我在哪里可以找到项目名称的定义要修改的变量。

这是,我需要设置这个:

<style name="ColorTheme" parent="android:Theme.Black">
    <item name="android:checkboxStyle">@style/CheckBoxColorTheme</item>
    <item name="android:buttonStyle">@style/ButtonColorTheme</item>
    <item name="android:imageButtonStyle">@style/ImageButtonColorTheme</item>
</style>

这里面:

<style name="Theme.CustomActionBarTheme" parent="@style/Theme.AppCompat">
    <item name="actionBarItemBackground">@drawable/ab_selectable_background</item>
    <item name="popupMenuStyle">@style/PopupMenu</item>
    <item name="dropDownListViewStyle">@style/DropDownListView</item>
    <item name="actionBarTabStyle">@style/ActionBarTabStyle</item>
    <item name="actionDropDownStyle">@style/DropDownNav</item>
    <item name="actionBarStyle">@style/ActionBar.Transparent</item>
    <item name="actionModeBackground">@drawable/cab_background_top_customactionbartheme</item>
    <item name="actionModeSplitBackground">@drawable/cab_background_bottom_customactionbartheme</item>
    <item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode</item>        
</style>

【问题讨论】:

标签: android android-actionbar customization android-holo-everywhere


【解决方案1】:

也许你需要这样做?

<style name="ColorTheme" parent="Theme.CustomActionBarTheme">
<item name="android:checkboxStyle">@style/CheckBoxColorTheme</item>
<item name="android:buttonStyle">@style/ButtonColorTheme</item>
<item name="android:imageButtonStyle">@style/ImageButtonColorTheme</item>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-19
    • 1970-01-01
    • 2010-12-08
    • 2014-09-06
    • 2019-10-22
    相关资源
    最近更新 更多