Android - How to draw a letter at a specific point?

前端 未结 4 1571
梦毁少年i
梦毁少年i 2021-01-16 11:14

I want to fill the screen with a 100 different letters in random positions. On the iPhone I just created a bunch of UILabels set their x and y positions and then used animat

4条回答
  •  余生分开走
    2021-01-16 11:49

    I think you are making a game and for this you should look into SurfaceView here is an good example then

    1...if you look into code there is onDraw method where you will get the width of screen and height

    2...Now taking this width and height as seed for random generator get x and y position.

    3...Iterate through point 2 100 times and you will get the desired result

提交回复
热议问题