Android的AppCompat修订21力的Holo主题 [英] Android AppCompat revision 21 force Holo theme
问题描述
在我的项目,我用appcompat-V7(修订版20),和我的项目是针对Android的API级别19(奇巧),所以我可以使用的Holo主题。我不小心更新Android的支持库修订21,所以我不得不改变目标清单中,以空气污染指数21(棒棒堂)。
正因为如此,我的应用程序的默认主题更改为材料(如复选框是绿色的)。有没有办法再次使用的Holo主题给力?
的Manifest.xml:
<舱单的xmlns:机器人=http://schemas.android.com/apk/res/android
包=my.package
安卓版code =1
机器人:VERSIONNAME =1.0>
<用途-SDK
安卓的minSdkVersion =8
机器人:targetSdkVersion =21/>
<应用
机器人:allowBackup =真
机器人:图标=@可绘制/ ic_launcher
机器人:标签=@字符串/ APP_NAME
机器人:主题=@风格/ AppTheme>
---活动和放大器;接收器---
< /用途>
< /舱单>
Style.xml:
<资源>
<样式名称=AppBaseTheme父=@风格/ Theme.AppCompat.Light.DarkActionBar>
< /风格>
<样式名称=AppTheme父=AppBaseTheme>
< /风格>
< /资源>
我终于通过下载Android的支持库,并通过使用@CommonsWare转换器.aar项目转换为一个库解决了这个问题。
in my project I was using appcompat-v7 (revision 20), and my project was targeting android API level 19 (KitKat), so I could use Holo theme. I accidentally updated "Android Support Library" to revision 21, so I had to change the target in manifest to API level 21 (Lollipop).
Because of this, my app's default theme changed to Material (e.g. checkboxes are green). Is there a way to force using Holo theme again?
Manifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
--- activities & receivers ---
</application>
</manifest>
Style.xml:
<resources>
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
</style>
<style name="AppTheme" parent="AppBaseTheme">
</style>
</resources>
I finally solved this problem by downloading the "Android support repository" and by converting the .aar project to a library using @CommonsWare converter.
这篇关于Android的AppCompat修订21力的Holo主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!