I want to implement the rotation in my application.
So I made my canvas autoresizing. Here's the code:
_canvas.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
But when I try to draw on it with touch the coordinates are bad.
Bad, I mean I touch somewhere on the screen the touchevent gives me other coordinates and the application draws on the wrong coordinate. If I don't rotate the iPhone the touchevent gives me the right coordinates. Any suggestions why can this happen?
Edit:
And one more thing. The (0, 0) coordinate is good. Higher coordinates are shifted to the lower-right corner.
Check this out, it should help
http://www.satosoft.com/index.php/2008/12/11/rotating-the-iphone-screen/#comments
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.