-1

i have my gamefield.xml and i only want is to draw in canvas with onDraw() a rectangle in gamefield.xml t manipulate... i have been search for the answer but nothing works...

what can i do for this,. Thank you .

This is my gamefield.xmlbu i dont think it is useful.

<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>
4

1 回答 1

0

根据创建自定义视图类文档,您的 XML 应如下所示:

<cruz.jayson.bantumi.Board
    android:id="@+id/myBoard"
    android:layout_width="fill_parent"
    android:layout_height="match_parent" />

您在元素名称中指定 View 类,而不是在class属性中。

于 2013-11-04T15:06:13.560 回答