【问题标题】:Custom Theme Android自定义主题安卓
【发布时间】:2014-07-02 15:58:04
【问题描述】:

在我正在制作的应用程序中,我想为我的一些显示小部件(对话框、操作栏等)设置主题,但将 Theme.Holo 作为我不想设置主题的东西(按钮、微调器等)的父项

所以在我的清单中我改变了:

android:theme="@android:style/Theme.Holo"

android:theme="@style/CustomTheme"

然后在 theme.xml 中我创建了我的 CustomTheme 并覆盖了我的操作栏和对话框:

<!-- Custom Holo (Dark) Theme -->
<style name="CustomTheme" parent="@android:style/Theme.Holo">
    <item name="android:actionBarStyle">@style/CarCastActionBar</item>
    <item name="android:alertDialogTheme">@style/CustomDialogTheme</item>
    <item name="android:dialogTheme">@style/CustomDialogTheme</item>
    <item name="android:alertDialogStyle">@style/CustomDialogTheme</item>
</style>

只是现在我的微调器已经恢复到丑陋的白色,而不是扁平的透明外观。 为什么要这样做?如果有帮助,我可以附上图片

【问题讨论】:

    标签: android xml android-spinner android-theme


    【解决方案1】:

    您使用的默认 Holo 主题需要深色背景。因此 ui 元素将具有白色半透明颜色。尝试使用 Holo Light 主题来拥有更暗的 ui 元素。

    android:Theme.Holo.Light
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-18
      • 2012-02-12
      • 1970-01-01
      • 2012-01-22
      • 2019-02-28
      • 2013-06-18
      • 2016-12-10
      相关资源
      最近更新 更多