首页 > Android提示元素必须后跟属性规范

Android提示元素必须后跟属性规范


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.example.framelayout"
android:versionCode="1"
android:versionName="1.0" >

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <uses-library android:name="android.test.runner"/>
</application>
<instrumentation android:name="android.test.InstrumentationTestRunner"
                 android:targetPackage="com.itcast.service"android:label="Tests for my app">
</instrumentation>

</manifest>

以上是完整代码。视频上用的是但标签</>这种的,以及我在网上查的也是用的但标签。但是用Alt+/提示出来的是双标签<></>.这个是为什么 ?
还有我检查过代码 没有缺少标签,单标签和双标签instrumentation这里都会提示图片上那个样子的错误。这是为什么?


在没有子属性的情况下,< />和<></>是一样的,出现你这种问题的原因很有可能是你的编码问题,确保你的代码书写过程中使用的是统一的字符编码,通常copy人家的代码最容易有这种问题。

【热门文章】
【热门文章】