开发者

How many times is onDraw() called?

开发者 https://www.devze.com 2023-01-16 23:14 出处:网络
I\'m just starting to play around with the android SDK, and was trying to build a simple bubble wrap app, so I could understand how custom components work. I have my onMeasure(), onSizeChanged(), onDr

I'm just starting to play around with the android SDK, and was trying to build a simple bubble wrap app, so I could understand how custom components work. I have my onMeasure(), onSizeChanged(), onDraw() methods which create the unpopped bubble bitmaps. I have a onTouchEvent() so I know which bubble number is being touched. After this I wanted to replace the unpopped bubble with a popped bubble image, and was wondering how I could go about doing that. If I understan开发者_运维技巧d it right, onDraw() is only called once initially right?

Thanks in advance!


Try override onDraw() and write a log message with Log.D(tag,message). Change the unpopped to popped image and call postInvalidate()

0

精彩评论

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