我创建了一个这样的类
public final class MyView extends View { public MyView(Context context,AttributeSet attrs) { super(context,attrs); [...] } [...] }@H_404_4@然后我想在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>@H_404_4@但Eclipse在错误日志中告诉我
@H_404_4@AndroidManifest: Ignoring unknown@H_404_4@如何在布局中使MyView可访问?我是否必须在其他地方发表这门课程?
‘com.hitziger.barcode.MyView’ XML
element
解决方法
你应该写它:
<view class="com.hitziger.barcode.MyView"...