我想将Date Picker的背景从白色更改为黑色,我认为可以通过将我的app主题更改为holo dark来完成。
目前它是: 我想将其改为全黑
因此,目前我的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>
Mainifest.xml
<application
.....
android:theme="@style/AppTheme" >
.......
</application>
我正在使用appcompat_v7
,那么我应该修改我的styles.xml
使用Holo Light和Dark Date Picker?
答案 0 :(得分:1)
当应用使用appcompat_v7解决问题时,将Theme.AppCompat
设置为主题的父级!
Theme.AppCompat
在视觉上与Theme.Holo(黑暗)相同。
有关详细信息,请参阅Android文档ActionBar以获取更多信息!
答案 1 :(得分:0)
android:Theme.Holo
复制此代码并将其粘贴到styles.xml
文件夹
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="android:Theme.Holo">
<!--
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="android:Theme.Holo">
<!-- 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="android:Theme.Holo">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
Mainifest.xml
<application
.....
android:theme="@style/AppTheme" >
.......
</application>
答案 2 :(得分:0)
确定所有个实例..
"Theme.AppCompat.Light"
......需要改为......
"Theme.AppCompat"
"Theme.AppCompat"
是appcompat
的{{1}}版本 - 黑暗版本
您无法使用"Theme.Holo"
,因为您使用的是"Theme.Holo"
库。它们不兼容。按照这个,它会工作!