开发者

can a class be extended with Activity and View, at a time?

开发者 https://www.devze.com 2023-03-30 04:03 出处:网络
i am new to android, and developing a snake/ladder game . i am using a statically defined image(10*10 board with snake n ladders drawn over it). i have defind this image in an xml(start.xml) file n se

i am new to android, and developing a snake/ladder game . i am using a statically defined image(10*10 board with snake n ladders drawn over it). i have defind this image in an xml(start.xml) file n setting this xml file in setContentView()(in start.java) . i also used button n edit boxes in the xml file. the button is dice. i want t开发者_运维问答o move the player position(in the form of drawing circle,each time, over the board image). .but drawing requires the class to be extended by view whereas, my class is extending activity.. how can i solve this issue???? i need a precise answer. Regards, Touqeer Fatima Malik


you can extend a view like this

MyView extends ImageView { ...

and use it in the xml as

<com.my.app.MyView ...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号