jjzjj

supportedInterfaceOrientations

全部标签

iOS 7+ 关闭模态视图 Controller 并强制纵向

我有一个UINavigationController作为我在iOS7和iOS8上的UIWindow的RootViewController。从它的一个ViewController,我展示了一个具有交叉溶解呈现样式的全屏模态视图Controller。这个模态视图Controller应该能够旋转到所有方向,并且工作正常。问题是当设备以横向放置并且模态视图Controller被关闭时。呈现模态的ViewController仅支持纵向,并且我已确认UIInterfaceOrientationMaskPortrait已返回到-application:supportedInterfaceOrient

ios - 无法在 iPad Air 2 上锁定方向

我正在处理的iOS应用程序有一个View需要锁定为横向。到目前为止,这是通过使用shouldAutorotate和supportedInterfaceOrientations方法完成的,但是在运行iOS9beta5iPadAir2上,这些方法永远不会触发,方向也不会锁定。我已经在以下设备上尝试过,除Air2外,所有设备都触发了方法(使用Xcodebeta6运行调试):iPhone6+、iPadMini、iPadAir2、iPad2、iPad3不触发的方法如下:-(BOOL)shouldAutorotate{returnYES;}-(UIInterfaceOrientationMask)

ios - 无法在 iPad Air 2 上锁定方向

我正在处理的iOS应用程序有一个View需要锁定为横向。到目前为止,这是通过使用shouldAutorotate和supportedInterfaceOrientations方法完成的,但是在运行iOS9beta5iPadAir2上,这些方法永远不会触发,方向也不会锁定。我已经在以下设备上尝试过,除Air2外,所有设备都触发了方法(使用Xcodebeta6运行调试):iPhone6+、iPadMini、iPadAir2、iPad2、iPad3不触发的方法如下:-(BOOL)shouldAutorotate{returnYES;}-(UIInterfaceOrientationMask)

ios - 在以不同方向呈现模态视图后保持父 View 的方向

所以我正在开发一个iPad应用程序,除了一个模态视图Controller外,它只支持横向模式。我遇到的问题是,一旦我呈现模态视图并将方向更改为纵向然后关闭View,父View(应该只支持横向)处于纵向模式,直到我旋转设备然后返回到景观并保持这种状态。我一直在折磨自己,试图弄清楚如何让parent看到原来的方向,但一直未能找到解决办法。我的应用程序委托(delegate)中有以下代码,仅允许在单个模态视图(GalleryPhotoViewer)上更改方向:-(NSUInteger)application:(UIApplication*)applicationsupportedInterf

ios - 在以不同方向呈现模态视图后保持父 View 的方向

所以我正在开发一个iPad应用程序,除了一个模态视图Controller外,它只支持横向模式。我遇到的问题是,一旦我呈现模态视图并将方向更改为纵向然后关闭View,父View(应该只支持横向)处于纵向模式,直到我旋转设备然后返回到景观并保持这种状态。我一直在折磨自己,试图弄清楚如何让parent看到原来的方向,但一直未能找到解决办法。我的应用程序委托(delegate)中有以下代码,仅允许在单个模态视图(GalleryPhotoViewer)上更改方向:-(NSUInteger)application:(UIApplication*)applicationsupportedInterf

iOS 9 supportedInterfaceOrientations 不工作

我有一个包含以下代码的UIViewController:-(BOOL)shouldAutorotate{returnNO;}-(NSUInteger)supportedInterfaceOrientations{returnUIInterfaceOrientationPortrait;}我没有使用UINavigationController。当显示此UIViewController时,设备仍会旋转到横向。我的目标是iOS9,这里有什么问题? 最佳答案 所以问题是我在info.plist中定义了允许的方向,这显然会覆盖您在整个项目中其

iOS 9 supportedInterfaceOrientations 不工作

我有一个包含以下代码的UIViewController:-(BOOL)shouldAutorotate{returnNO;}-(NSUInteger)supportedInterfaceOrientations{returnUIInterfaceOrientationPortrait;}我没有使用UINavigationController。当显示此UIViewController时,设备仍会旋转到横向。我的目标是iOS9,这里有什么问题? 最佳答案 所以问题是我在info.plist中定义了允许的方向,这显然会覆盖您在整个项目中其

iOS 8 UIActionSheet 忽略 View Controller supportedInterfaceOrientations 和 shouldAutorotate

我有一个应用程序,它通过plist文件配置为支持纵向、左侧横向和右侧横向(即UISupportedInterfaceOrientations设置为UIInterfaceOrientationPortrait、UIInterfaceOrientationLandscapeLeft和UIInterfaceOrientationLandscapeRight)。但我已将支持的方向限制为仅在ViewController内纵向。如果我在ViewController的View上显示UIActionSheet然后旋转设备,则UIActionSheet会旋转到新的方向。这仅发生在运行iOS8(GMSee

iOS 8 UIActionSheet 忽略 View Controller supportedInterfaceOrientations 和 shouldAutorotate

我有一个应用程序,它通过plist文件配置为支持纵向、左侧横向和右侧横向(即UISupportedInterfaceOrientations设置为UIInterfaceOrientationPortrait、UIInterfaceOrientationLandscapeLeft和UIInterfaceOrientationLandscapeRight)。但我已将支持的方向限制为仅在ViewController内纵向。如果我在ViewController的View上显示UIActionSheet然后旋转设备,则UIActionSheet会旋转到新的方向。这仅发生在运行iOS8(GMSee

iOS 6 旋转 : supportedInterfaceOrientations doesn´t work?

我在使用iOS6SDK时遇到了这个问题:我有一些View应该允许旋转(例如视频View),而有些则不允许。现在我知道我必须检查应用程序的Info.plist中的所有方向,然后在每个ViewController中整理,应该发生什么。但它不起作用!该应用程序始终旋转到Info.plist中给出的方向。信息.plist:UISupportedInterfaceOrientationsUIInterfaceOrientationPortraitUIInterfaceOrientationLandscapeLeftUIInterfaceOrientationLandscapeRight任何不应允