iPhone 横屏竖屏旋转时坐标原点变换的方法
2010-09-07 13:57
2695 查看
一般 iPhone 正常工作(即竖屏)时,坐标原点(0,0)位于左上角。但如果用户把 iPhone 横过来,或者程序是横屏运行的,下面的方法能让横屏开发时坐标原点(0,0)依然位于左上角(当然,如果从纵屏的角度来看就是左下角或者右上角)。
在info.plist中增加一项:
UIInterfaceOrientation
UIInterfaceOrientationLandscapeRight
再加一项 initial interface orientation Landscape(right)
View- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
在 interface builder 中,点选窗口右上角的旋转图标,把窗口视图转成水平的。
原帖地址 http://www.cocoachina.com/bbs/read.php?tid-15566.html,欢迎参与讨论
在info.plist中增加一项:
UIInterfaceOrientation
UIInterfaceOrientationLandscapeRight
再加一项 initial interface orientation Landscape(right)
View- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
在 interface builder 中,点选窗口右上角的旋转图标,把窗口视图转成水平的。
原帖地址 http://www.cocoachina.com/bbs/read.php?tid-15566.html,欢迎参与讨论
相关文章推荐
- iOS横屏竖屏旋转的方法(怕留网址会消失,直接复制内容过来了)
- iphone 旋转横屏与竖屏切换view
- Nyoj 298 点的变换[利用矩阵求解坐标点的转换,平移,绕原点旋转,沿x,y轴翻转]
- 解决iphone横屏时字体变大问题最佳方法
- ios(ipad,iphone)屏幕旋转检测通用方法
- iOS屏幕旋转之为横屏视频播放增加竖屏模式
- IPAD横屏坐标原点问题
- iphone ios 横屏,旋转 无响应
- android设置横屏和竖屏的方法
- iOS中锁定竖屏不让其横屏的方法
- 世界坐标变换要先缩放、后旋转、再平移的原因
- C#实现计算一个点围绕另一个点旋转指定弧度后坐标值的方法
- 对点云进行刚体变换时如果同时绕三个坐标轴进行旋转会有问题
- android设置横屏和竖屏的方法
- ios(ipad,iphone)屏幕旋转检测通用方法
- 基于jQuery的判断iPad、iPhone、Android是横屏还是竖屏的代码
- Android禁止横屏竖屏切换的有效方法
- [JS代码]如何判断ipad或者iphone是否为横屏或者竖屏 - portrait或者landscape
- ionic2/3 禁止屏幕旋转,禁止横屏,竖屏
- 如何判断ipad或者iphone是否为横屏或者竖屏 - portrait或者landsc