在使用Android Studio创建自定义控件的自定义属性时,需要声明命名空间,
如:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:round = "http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.hm.myimooc.RoundRectXfermodActivity">
<com.example.hm.myimooc.RoundRectXfermodeView
android:id="@+id/fermodView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
round:roundbitmap ="@drawable/test3"/>
</LinearLayout>
在eclipse中声明命名空间是
xmlns:自定义字段 = "http://schemas.android.com/apk/你的应用的包名"
<span style="font-family: Arial, Helvetica, sans-serif;">xmlns:自定义字段 = "http://schemas.android.com/apk/res-auto"</span>
xmlns:自定义字段 = "http://schemas.android.com/apk/你的应用的包名"