开发者

How to get the pointer to canvas for a custom view in a user defined function in android

开发者 https://www.devze.com 2023-04-12 22:11 出处:网络
I have an activity which extends view i.e. its a custom view.I want to get the pointer to the canvas in my own function to draw something instead of the overridden ondraw/draw methods.Is it po开发者_开

I have an activity which extends view i.e. its a custom view.I want to get the pointer to the canvas in my own function to draw something instead of the overridden ondraw/draw methods.Is it po开发者_开发问答ssible?


override ondraw(Canvas canvas) and don't call super.ondraw(). Call instead myCustomDraw(canvas) and draw to that canvas. That's the View's canvas

0

精彩评论

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

关注公众号