尝试使用全息主题,在Android中不工作 [英] Trying to use holo theme in Android not working
问题描述
我一直在试图建立一个全息主题Android的,但我一直没能得到它承认它。任何想法?
I've been trying to set a holo theme in Android, but I haven't been able to get it to recognize it. Any ideas?
发布是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:theme="@android:style/Theme.Holo">
<activity
android:name=".TestActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
它给我的红线下 @android:款式/ Theme.Holo
即使我改变的minSdkVersion至11任何想法
It gives me the red line under @android:style/Theme.Holo
even if I change the minSdkVersion to 11. Any ideas?
我改了行&LT;使用-SDK安卓的minSdkVersion =7安卓targetSdkVersion =15/&GT;
到&LT ;使用-SDK安卓的minSdkVersion =7安卓。targetSdkVersion =15/&GT;
,我仍然得到同样的错误
I changed the line <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
to <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
and I am still getting the same error.
这结束了,我的目标API是在清单中正确指定,而不是在项目属性。奇怪,但现在因为是很好。
This ended up being that my target api was specified correctly in the manifest, but not in project properties. Weird, but now as is well.
推荐答案
您要使用的Holo主题API低比Android 4.0,这就是为什么你得到的红线,您可以:
you are trying to use the Holo theme for API Low than Android 4.0 that's why you get the red Line you can:
- 使用 HoloEverywhere 项目
- 挑全息主题必要的资源,你最想要的 ICS源和创建自己的自定义主题/样式 https://github.com/android/platform_frameworks_base/tree/master/core/res
- 您CA也试图用一个自定义的主题为Android阿比7至10 和全息主题阿比11或更高,看到@Alex洛克伍德的 的回答。
- Use the HoloEverywhere project
- Pick the necessary resources for Holo Theme you most want from the ICS source and create your own custom theme/styles https://github.com/android/platform_frameworks_base/tree/master/core/res
- You ca also try to make use a custom theme for Android Api 7 to 10 and the holo theme for Api 11 and higher, see @Alex Lockwood's answer.
这篇关于尝试使用全息主题,在Android中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!