Rectangle not updating nor showing color

后端 未结 1 1523
悲哀的现实
悲哀的现实 2021-01-26 10:23

I am having issues with by rectangle not stopping (hard coded values due to bugs with grabbing screen height) in addition, when I draw with red paint, I always get a black recta

相关标签:
1条回答
  • 2021-01-26 10:51

    The Paint(int) constructor doesn't take a color value; those are actually flags.

    Just use setColor(int) instead.

    If you want it to animate, add a call to invalidate() to your onDraw() routine (doesn't really matter where). That way, it keeps getting redrawn, in an endless cycle. Also, call update() inside onDraw() as well. Kind of a "poor-man's" animation, but it should get you going.

    0 讨论(0)
提交回复
热议问题