Java eclipseandroid中视图类与xml的连接
我有gamefield.xml,我只想在画布上用onDraw()在gamefield.xml中画一个矩形。。。我一直在寻找答案,但没有任何效果 我能为此做些什么,。多谢各位 这是我的游戏场。我不认为它有用Java eclipseandroid中视图类与xml的连接,java,android,xml,eclipse,Java,Android,Xml,Eclipse,我有gamefield.xml,我只想在画布上用onDraw()在gamefield.xml中画一个矩形。。。我一直在寻找答案,但没有任何效果 我能为此做些什么,。多谢各位 这是我的游戏场。我不认为它有用 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="ver
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<View class= "cruz.jayson.bantumi.Board"
android:id="@+id/myBoard"
android:layout_width="fill_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
根据,您的XML应该如下所示:
<cruz.jayson.bantumi.Board
android:id="@+id/myBoard"
android:layout_width="fill_parent"
android:layout_height="match_parent" />
您可以在元素的名称中指定视图类,而不是在
class
属性中指定视图类。define不起作用。。