【问题标题】:How to upgrade the current API level如何升级当前 API 级别
【发布时间】:2014-05-15 22:18:04
【问题描述】:

在创建如下所示的textview 时,eclipse 用红色曲线强调了此textview 的一些属性,提示标签为....requires level API 14

我如何知道我当前的 API 级别?以及如何升级?

xml_代码:

<TextView
           android:id="@+id/latLabel"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:layout_alignParentTop="true"
           android:gravity="left"
           android:text="@string/latLabel"
           android:textSize="@dimen/dividerTitleSize"
           android:textColor="@android:color/holo_red_dark">

【问题讨论】:

    标签: android eclipse eclipse-plugin


    【解决方案1】:

    签入您的清单文件。

    你应该有一个类似的行:

    <uses-sdk
            android:minSdkVersion="10" <--Set to 14 if you want to require API 14
            android:targetSdkVersion="17" />
    

    如果你不确定添加它。

    【讨论】:

      【解决方案2】:

      您需要将 Android 清单中的当前 API 级别更改为 14 或更高版本。如果您想保持 API 级别低于 14 并使用红色,请在 res/values 文件夹中添加“color.xml”文件,然后在该 XML 文件中输入以下代码:&lt;color name="red"&gt;#ffff0000&lt;/color&gt;

      那么你可以使用android:textColor="@color/red"

      【讨论】:

        【解决方案3】:

        进入项目中的Manifest文件并检查

         <uses-sdk
                android:minSdkVersion="8"
                android:targetSdkVersion="19" />
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-11-11
          • 1970-01-01
          • 2018-10-20
          • 1970-01-01
          • 2013-10-31
          • 1970-01-01
          相关资源
          最近更新 更多