我正在学习按照http://developer.android.com中的教程开发 android 应用程序。
现在我正在处理http://developer.android.com/training/custom-views/create-view.html,当我构建应用程序时出现错误:
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'showText' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'labelHeight' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'labelWidth' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'labelY' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'labelPosition' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'highlightStrength' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'pieRotation' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'labelColor' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'autoCenterPointerInSlice' in package 'com.example.android.customviews.charting'
D:\sviluppo\netbeans\custom-view\res\layout\main.xml:24: error: No resource identifier found for attribute 'pointerRadius' in package 'com.example.android.customviews.charting'
我从网站下载了代码并按原样安装了它,没有任何更改,所以 main.xml 是
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/com.example.android.customviews"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.example.android.customviews.charting.PieChart
android:id="@+id/Pie"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:layout_weight="100"
custom:showText="true"
custom:labelHeight="20dp"
custom:labelWidth="110dp"
custom:labelY="85dp"
custom:labelPosition="left"
custom:highlightStrength="1.12"
android:background="@android:color/white"
custom:pieRotation="0"
custom:labelColor="@android:color/black"
custom:autoCenterPointerInSlice="true"
custom:pointerRadius="4dp"
/>
<Button
android:id="@+id/Reset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/reset_button"
/>
</LinearLayout>
和命名空间是一样的。
您能帮我理解为什么会出现这些错误吗?非常感谢。