Best way to draw tournament bracket in Android

随声附和 提交于 2020-03-03 09:27:28

问题


I need to draw a tournament bracket in Android. I already calculated the positions for all games (i.e. an (x,y) tuple that defines where to place teams in a spreadsheet-like structure). However, I don't know the preferred way of drawing the bracket. I found an example that shows what I need:Example

My first idea was to programmatically create and fill a TableLayout. However, borders are not really supported and a lot of TextViews are needed to fill the space between games. So I am not sure if this is the best way to do it.

Does anyone have better suggestions or maybe even an example of something similar?


回答1:


I'd suggest custom drawing using Canvas. That way you can draw wherever it makes sense and probably even support zooming without too much work.



来源:https://stackoverflow.com/questions/11213629/best-way-to-draw-tournament-bracket-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!