gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 02:45:20 24 4
gpt4 key购买 nike

我想将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com