Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/213.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不同Android SDK版本的不同主题_Android_Android Layout_Android Theme - Fatal编程技术网

不同Android SDK版本的不同主题

不同Android SDK版本的不同主题,android,android-layout,android-theme,Android,Android Layout,Android Theme,根据安装应用程序的SDK版本,是否有方法使用不同的主题 我问这个问题的原因是因为我想一直支持SDK版本8,但是对于那些拥有ICS的用户,我希望能够遵循ICS的设计标准并使用Holo主题 我可以从中看出,我可以有一个文件夹values-v14,它将有一个theme.xml来覆盖主题声明。但是,如果我引用Theme.Holo,它将不会编译。我相信这是因为我的AndroidManifest.xml中有以下内容 <uses-sdk android:minSdkVersion="8" /> &

根据安装应用程序的SDK版本,是否有方法使用不同的主题

我问这个问题的原因是因为我想一直支持SDK版本8,但是对于那些拥有ICS的用户,我希望能够遵循ICS的设计标准并使用Holo主题

我可以从中看出,我可以有一个文件夹values-v14,它将有一个theme.xml来覆盖主题声明。但是,如果我引用Theme.Holo,它将不会编译。我相信这是因为我的AndroidManifest.xml中有以下内容

<uses-sdk android:minSdkVersion="8" />
<uses-sdk android:targetSdkVersion="11"/>
您所做的(使用values-v14文件夹)是正确的。您只需要更改构建目标以允许它进行编译。(右键单击项目,选择属性,选择Android,选择Android 14或更高版本)


确保不要使用比android:Minsdk版本更大的任何功能,因为如果在早期版本的android上使用,将导致强制关闭。

您可以发布两个theme.xml文件吗?
<application
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:name=".Refunder"
    android:theme="@style/MainTheme"
    >
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MainTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:typeface">normal</item>
        <item name="android:textSize">15sp</item>
    </style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MainTheme" parent="@android:style/Theme.Holo">
        <item name="android:typeface">normal</item>
        <item name="android:textSize">15sp</item>
    </style>
</resources>
error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Holo'