开发者

Iphone rotation

开发者 https://www.devze.com 2022-12-14 05:21 出处:网络
I want to implement the rotation in my application. So I made my canvas autoresizing. Here\'s the code:

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

0

精彩评论

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