android - 如何在 Eclipse 中更改应用程序主题

标签 android xml eclipse android-theme android-appcompat

我想将 Date Picker 的背景从白色更改为黑色,我认为可以通过将我的应用主题更改为 holo dark 来完成。

目前是: enter image description here我想把它改成全黑 enter image description here

因此,目前我在 values 文件夹中的 styles.xml

<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

</resources>

values-v11 styles.xml

<resources>

<!--
    Base application theme for API 11+. This theme completely replaces
    AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!-- API 11 theme customizations can go here. -->
</style>

</resources>

values-v14 styles.xml

<resources>

<!--
    Base application theme for API 14+. This theme completely replaces
    AppBaseTheme from BOTH res/values/styles.xml and
    res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- API 14 theme customizations can go here. -->
</style>

</resources>

主要文件

<application
   .....
   android:theme="@style/AppTheme" >
   .......
</application>

我正在使用 appcompat_v7,那么我应该如何修改我的 styles.xml 使用 Holo Light 和 Dark Date Picker?

最佳答案

当应用程序使用 appcompat_v7 时,将 Theme.AppCompat 设置为主题的父项解决了这个问题!

Theme.AppCompat 在视觉上与 Theme.Holo(深色)相同。

有关详细信息,请参阅 Android 文档 ActionBar获取更多信息!

关于android - 如何在 Eclipse 中更改应用程序主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25141195/

相关文章:

java - 如何从 List<> 中删除项目?

android - 如何更改android :inputType ="phone" to android:inputType ="textEmailAddress" from java?

XML 编写器命名空间

c# - 字符串转义为 XML 属性

c# - 删除 XML 节点

eclipse - 有没有自动优化Eclipse.ini文件的插件?

java - 运行我的新代码运行我的旧代码?

Android - Firebase 按值排序

Android应用程序将图片发送到网络服务器并旋转图片

android - 如何指向已安装的Android Studio sdk