android - Eclipse Android 2.2项目报错但是Android 4.0没有报错

标签 android eclipse sdk adt

当我在 eclipse 中为较低的 android 2.2 标签 API8 创建新项目时,出现了一些错误,我无法修复它们。 appcompat_v7 里面有一些问题 no found values-v17 - values-v21 我的项目文件夹也有一些错误。

enter image description here

创建后......

enter image description here

但是当我为更高版本的 android 4.0 标签 API(14) 创建项目时没有错误。

enter image description here

创建后......

enter image description here

有什么办法可以解决这个问题。

最佳答案

在 4.0 中,他们使用 android: 样式前缀,但在 2.2 中,他们无法识别 在 4.0 中

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CodeFont" parent="@android:style/TextAppearance.Medium">
        <item name="android:layout_width">fill_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">#00FF00</item>
        <item name="android:typeface">monospace</item>
    </style>
</resources>

在 2.2 中

 <style name="WindowTitle">
        <item name="singleLine">true</item>
        <item name="textAppearance">@style/TextAppearance.WindowTitle</item>
        <item name="shadowColor">#BB000000</item>
        <item name="shadowRadius">2.75</item>
    </style>

就像明智的事情发生了变化。所以引用android developer.android.com 或者您可以使用 2.2 中的单独样式表。而且在没有看到 style.xml 的情况下,我们不能说这就是问题所在。

关于android - Eclipse Android 2.2项目报错但是Android 4.0没有报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36147008/

相关文章:

java - 以编程方式下载 Android SDK

java - 将 arraylist 的一些元素添加到 JSONArray 并使用 Volley 进行 POST

android - 在 android 插件中安装时遇到问题

java - 安卓 : Adding bottom border to relativeLayout programatically?

java - LibGDX 3d 模型纹理无法正确渲染

java - Eclipse 导出可运行的 jar,其中主类位于库 jar 中

iphone - 安装新的 XCode 恢复以前的 SDK(已弃用)

ios - Spotify 身份验证流程 SDK 中的未知错误

Java Firestore Android 在查询中使用数组列表来显示来自关注用户的帖子

android - 无法在 Android Studio 中安装模拟器