jjzjj

supportedInterfaceOrientations

全部标签

ios - preferredInterfaceOrientationForPresentation 必须返回支持的界面方向 (iOS 6)

我的应用程序窗口的RootViewController是UINavigationController的子类。我已将此代码添加到类(class)中:-(BOOL)shouldAutorotate{return[self.topViewControllershouldAutorotate];}-(NSUInteger)supportedInterfaceOrientations{return[self.topViewControllersupportedInterfaceOrientations];}-(UIInterfaceOrientation)preferredInterfaceOr

swift - 在 swift 4 中为 UINavigationController 和 UIViewController 禁用屏幕方向

您好,我想在我的项目中的一个ViewController中停止自转。在下面的快照中,我有一个起始UINavigationController,然后是一个UIViewController。我已经实现了以下代码来停止自转:extensionUINavigationController{overrideopenvarshouldAutorotate:Bool{get{returnfalse}}overrideopenvarsupportedInterfaceOrientations:UIInterfaceOrientationMask{get{returnUIInterfaceOrienta

ios - 将所有屏幕方向锁定为纵向,除了 1

我正在开发一个只能在纵向模式下访问的iOS应用程序。除了我正在使用的1个框架(我map中80个屏幕中的1个)需要横向支持。因此我不得不在我的plist中允许它。确保所有其他View都以纵向显示并且只能以纵向显示的最简单方法是什么?关于我的项目的一个好处是所有其他ViewController都继承自ProjectViewController。首选使用Swift的答案。 最佳答案 classProjectViewController:UIViewController{overridevarsupportedInterfaceOrient

swift - iOS 10 和 swift 2.3 中的 supportedInterfaceOrientations

我正在使用Xcode8GM,并且有一个旧项目需要针对iOS10进行更新。我发现我当前使用Swift2.2版构建的应用商店在iOS10上运行时不支持所需的界面方向功能简单地说,当我覆盖supportedInterfaceOrientations()时,它在iOS10上运行时永远不会被调用。在以前的版本上它工作正常。我可以看到签名已更改,因此supportedInterfaceOrientations现在是一个var而不是方法,但这似乎只适用于Swift3而不是Swift2.3。当我尝试在Swift2.3中作为var覆盖时,它不会编译,如果我使用旧签名,它永远不会在iOS10下被调用有什么

iOS:supportedInterfaceOrientations() 的旋转问题

我正在使用Storyboard快速构建应用程序。它由UITabBarController组成,一个UINavigationControllerandthreeUIViewController`。TabBarController->NavigationController->ViewController1->VC2->VC3我想构建应用程序,以便第一个2个ViewController只能在Portrait中,第三个只能在LandscapeRight中。我为UITabBarController创建了一个子类:classOrientationTab:UITabBarController{ov

ios - supportedInterfaceOrientations 在除 6+ 以外的所有 iPhone 上调用

在我的iPhone应用程序上,我将它限制为仅在项目目标部署信息下的纵向有一个页面我只想要横向的,我使用supportedInterfaceOrientations方法来获得它。标准实现:overridefuncsupportedInterfaceOrientations()->UIInterfaceOrientationMask{returnUIInterfaceOrientationMask.Landscape}除iPhone6+外,它在所有iPhone设备和iOS版本上都能完美运行。永远不会调用supportedInterfaceOrientations方法。我找不到任何可能只影响

ios - 如何在 AVPlayer 中强制横向模式?

我正在寻找一种方法来强制AVplayer(视频)仅在横向模式下显示自身(左侧的主页按钮)。这可能吗?编辑:尝试添加playerViewController.supportedInterfaceOrientations=.landscapeLeft收到错误信息“无法分配给属性:‘supportedInterfaceOrientations’是一个只获取属性”importAVKitimportAVFoundationUIViewController{varvideoPlayer=AVPlayer()varplayerViewController=AVPlayerViewController

ios - supportedInterfaceOrientations 不工作

我想要一些ViewControllers风景和一些肖像,所以这就是我所做的:我启用了横向模式:接下来我将这些代码行添加到我想成为肖像的ViewController中:-(NSUInteger)supportedInterfaceOrientations{returnUIInterfaceOrientationPortrait;}-(BOOL)shouldAutorotate{returnNO;}-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{returnUIInterfaceOrientatio

ios - supportedInterfaceOrientations 不工作

我想要一些ViewControllers风景和一些肖像,所以这就是我所做的:我启用了横向模式:接下来我将这些代码行添加到我想成为肖像的ViewController中:-(NSUInteger)supportedInterfaceOrientations{returnUIInterfaceOrientationPortrait;}-(BOOL)shouldAutorotate{returnNO;}-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{returnUIInterfaceOrientatio

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

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