How to build custom grid
I have a problem and i will be grateful if anyoune helps me.
Ok. I've started android programming 2 mon开发者_Python百科th ago. Now i am developing a simple game, nava battle. For this programm i need to build a grid, where i can place ships and coordinates. I can't seem to find out how I should be doing this? I think i should build a custom view, which will do all that i need. If anyone could show some examle or explain how to build appropriate view i'll be happy
IMO you should consider extending or at least using a GridView
and place your UI components inside it. The Adapter backing the Gridview could contain information about the co-ordinates and Images(ships).
I think the following would be useful to you:
Beginners tutorial on GridViews
Building custom components
This is an example of board game developed on Android:Chess on Android
精彩评论