Android How to create a View Programmatically

后端 未结 2 1582
广开言路
广开言路 2021-01-05 11:02

I need to create a view programmatically. The controls(buttons, labels, etc.) and their positions are known only at runtime.

Here I found \"Defining a Layout Program

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-05 11:50

    I would take a look at the Lunar lander example in the android API samples here http://developer.android.com/resources/samples/LunarLander/index.html. This helped me out tremendously when starting out making games and having to dynamically draw to the screen.

提交回复
热议问题