iPhone - 屏幕旋转? [英] iPhone - Screen Rotation?

查看:139
本文介绍了iPhone - 屏幕旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UIDeviceOrientation &的区别是什么? UIInterfaceOrientation

What's the difference between UIDeviceOrientation & UIInterfaceOrientation ?

我应该使用哪一个来检测UIView上的旋转?

Which one should I use to detect rotation on a UIView?

推荐答案

UIDeviceOrientation 为您提供有关物理设备本身的信息,同时 UIInterfaceOrientation 告诉您它正在显示的视图的方向。这些不需要匹配;当用户使用方向锁定或设备方向正面朝上时。

UIDeviceOrientation gives you information about the physical device itself while UIInterfaceOrientation tells you about the orientation of the views it is displaying. These do not need to match; when a user uses the orientation lock or if the the device orientation is face up.

您可能想要检查 UIInterfaceOrientation UIViewController 上的旋转方法,以确定何时已经或应该轮换视图。

You probably want to be checking UIInterfaceOrientation and the rotation methods on UIViewController to determine when views have been or should be rotated.

这篇关于iPhone - 屏幕旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆