简体   繁体   中英

Iphone rotation

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.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM