这个我创建的视图类:
public final class MyView extends View {
public MyView(Context context, AttributeSet attrs) {
super(context, attrs);
[...]
}
[...]
}
然后我想把这个视图放在layout.xml中使用:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.hitziger.barcode.MyView
android:id="@+id/my_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
但是Eclipse报出了log的错误:
AndroidManifest: Ignoring unknown 'com.hitziger.barcode.MyView' XML element
在布局中怎么使用自定义的视图?