Android Question Canvas stretched by modifying the parent's size?

KMatle

Expert
Licensed User
Just played arround with canvas to draw some things. I've assigned a canvas to a panel of a horizontal scrollview. After that I increase the panel's width stepwise. From about 300%x the canvas gets stretched.

Looks like a canvas has the exact size of it's parent (here: the panel) when it gets initialized. Increasing the width will stretch the canvas. Am I right here?
 

klaus

Expert
Licensed User
Increasing the width will stretch the canvas. Am I right here?
Yes. If you want the canvas having the new dimensions of the parent view you must initialize it again.
 
Top