Iphone:手动更改方向

Dmi*_*try 0 iphone

如何手动调用shouldAutorotateToInterfaceOrientation?

这个功能的内容有开/关标志,所以当我改变这个标志时,我需要旋转屏幕.

例:

  1. 禁用标志
  2. 将手机倾斜到水平位置.shouldAutorotateToInterfaceOrientation调用并返回false
  3. 启用标志:必须调用shouldAutorotateToInterfaceOrientation.怎么称呼它?

UIA*_*dam 5

如果您的目标是iOS 5,则可以致电

[UIViewController attemptRotationToDeviceOrientation]

它将调用shouldAutorotateToInterfaceOrientation:设备的当前方向,并在该方法返回时旋转接口YES.