English 中文(简体)
仅对模式UIVVC主计长进行支持性指导
原标题:Only support orientation for modal UIViewController

我的应用程序有一个 UINADIGATION 控制器, 它不支持旋转 。 但是我要在导航控制器上方显示一个应该支持旋转的模式查看控制器 。 这是否可能? 我试图在视图控制器上跳过 < code> 应该自动旋转到 InterfaceOrentation , 该控制器显示时时时, 却看起来不起作用 。

最佳回答
问题回答

我认为,除了显示时态返回 YES 的视图控制器 < code> 外,还应将您的导航控制器s < autorotate to Interface指导 替换为 YES ,当该模式查看控制器显示时,返回 > YES ,否则,返回 no

您需要确保您的设备生成设备定向通知( UIDevicalentation Did ChangeNationation) :

确保:

generates DeviceOrentation通知 已设定为真

苹果医生写道:

“ 窗口对象所做的大部分工作都与改变当前方向有关。 但是, 它与根视图控制器一起工作, 以确定是否真的应该改变方向, 如果是的话, 应该用什么其他方法来回应变化。 如果这个控制器是一个容器, 它可能要依靠孩子来决定是否应该改变方向 。 ”

如果您的 root 视图控制器( 用户导航控制器? ) 不支持旋转, 程序启动时可能会设置为假 。 在这种情况下, 您需要在适当时将其打开 :

UIDevice myDevice = [UIDevice currentDevice]; 
[myDevice beginGeneratingDeviceOrientationNotifications]; 




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签