开发者

Android Layout doesn't fit into contiguous rectangles

开发者 https://www.devze.com 2023-01-17 18:21 出处:网络
I am a new Android developer, and though I have spent a LOT of time reading through the official developer guide/reference (as well has hours of guessing/checking), I\'m still stumped about the best w

I am a new Android developer, and though I have spent a LOT of time reading through the official developer guide/reference (as well has hours of guessing/checking), I'm still stumped about the best way to do my layout. I am creating a board game, and here is an image of the game board. On that board, the game pieces live on (and move between) the small inner hexes. From my limited understanding of Android development, I'm thinking I need to make each small hex a view. And the overall board layout would be a stacking together of these small hex images to form the board shape. The end result would look exactly like the gameBoard image I linked above. IMPORTANT: 开发者_如何学编程I want the game board to be on the bottom of the screen, with game info (players, scores, etc.) at the top. For now I am focusing on a portrait layout...I'll deal with landscape mode later.

The trouble I'm having is figuring out how to do the layout. I want to use XML tags for this portion of the layout, because the board itself will never change during the game play. Only the game pieces will move around on the static board. I have spent hours so far researching and trying different layout types, and combinations of different layouts...nothing I've tried gives me that board design. As you can see from the board image, the hexes don't line up into nice rows/columns. I think this is why I am struggling to get my small hex views to look like the board. Any ideas? Or am I going about this in the wrong way altogether?


You say the board will not change, then why don't you use a single (vector) image to represent the whole board? I am not sure if android supports SVG though

0

精彩评论

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