Tag: uiinterfaceorientation

iOS 7.仅更改一个视图控制器的页面方向

我有iPhone应用程序,只支持肖像方向。 我想添加到我的项目视图控制器,将只支持横向方向? 可能吗? 如果是的话我怎么能做到这一点? 我试图把这个类文件打包成这样: @implementation UINavigationController (Rotation_IOS7) -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } 如果我这样做,我得到这个错误:终止应用程序由于未捕获的exceptionUIApplicationInvalidInterfaceOrientation ,原因: Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES

UISplitViewController和方向 – iOS <5.0

我正在使用一个splitviewcontroller作为我的应用程序的rootview。 我需要将login和注册视图显示为splitviewcontroller上方的模式视图。 当我尝试从splitViewController的rootview的viewdidAppear方法呈现login/ reg视图,它不显示。 我尝试使用下面的代码从Appdelegate的didFinishLaunching方法呈现login/注册视图 [self.window.rootViewController presentModalViewController:self.navController animated:NO]; 它的工作。 我的问题是,应用程序支持两个风景方向,但是当我在设备中运行它,无论在哪个方向我拿着设备,我只得到作为方向的LandscapeRight。 所以,如果我在LandscapeLeft方向持有该设备,应用程序与login屏幕颠倒。 我在info.plist上使用LandscapeLeft&Right支持方向。 请帮我解决这个问题。 当我们将splitViewcontroller作为应用程序的rootview时,我们将如何呈现视图? 在iOS 5.0(仅限于)中,我能够显示来自splitviewcontroller的rootview控制器 – viewdidAppear方法的login视图。 在所有其他操作系统版本中,这种情况不起作用,我需要从Appdelegate的didFinishLaunching方法中提出。

窍门preferredInterfaceOrientationForPresentation触发viewController更改

我从这里使用MSNavigationPaneViewController ,并有旋转sorting的工作。 我已经覆盖了我的根UINavigationController的旋转方法 -(BOOL)shouldAutorotate { return YES; } -(NSUInteger)supportedInterfaceOrientations { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; if (appDelegate.topViewController != nil) { return [appDelegate.topViewController supportedInterfaceOrientations]; } else { return UIInterfaceOrientationMaskPortrait; } } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; if (appDelegate.topViewController != nil) { return [appDelegate.topViewController preferredInterfaceOrientationForPresentation]; } else { return UIInterfaceOrientationPortrait; […]

iOS:初始界面方向在plist中被忽略

我试图将我的应用程序的初始方向设置为UIInterfaceOrientationLandscapeLeft 我不能得到 'Initial interface orientation'[UIInterfaceOrientation] 覆盖数组中的第一个项目 'Supported interface orientations'[UISupportedInterfaceOrientations] 我注意到一个iPhone应用程序总是以'肖像(底部主页button)'开头,数组是: 'Supported interface orientations'[UISupportedInterfaceOrientations] Portrait (bottom home button) Landscape (left home button) Landscape (right home button) 这是预期的。 如果在“摘要”页面上将“肖像主页底部”buttonclosures,则返回上一页,然后数组顺序改变,肖像(底部主页button)移动到底部。 Landscape (left home button) Landscape (right home button) Portrait (bottom home button) 当我运行的应用程序现在开始景观(左主页button),因为这现在是列表的顶部。 这很好 但 当我添加 'Initial interface orientation'[UIInterfaceOrientation] 并将其设置为 Landscape (right home button) 它被忽略,并使用数组中的第一个项目 Landscape (left home […]

仅限肖像模式 – iOS

我有一个应用程序,只为纵向devise。 但是,我不知道如何限制只使用肖像模式,一旦用户颠倒或空间模式,我不希望我的屏幕orignation相应的变化。 任何想法如何做到这一点?

iPad的风景和肖像与大小类不同的布局

如何使用Size类devise具有不同布局的iPad横向和纵向屏幕。 我只能在两个方向上findw-正则和h-正则。 例如:我需要使用Size Class纵向alignment2个视图,横向alignment2个视图

查看轮播通知:为什么didRotateFromInterfaceOrientation:没有被调用?

我正在尝试检测任何设备方向更改,以便我可以更新视图。 我想更新视图方向是纵向还是横向,所以我实现了这个方法: – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations. return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft); } 我知道,如果我想更新视图以正确显示当前的方向,我将需要实现以下一些方法: – willRotateToInterfaceOrientation:duration: – willAnimateRotationToInterfaceOrientation:duration: – didRotateFromInterfaceOrientation: – willAnimateFirstHalfOfRotationToInterfaceOrientation:duration: – didAnimateFirstHalfOfRotationToInterfaceOrientation: – willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration: 现在,问题是,我不明白为什么这些方法没有被激发,当我旋转模拟器。 我也试过这段代码: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; 但仍然没有。 所以我想知道,模拟器是否会启动轮转通知? 如果是的话,我在做什么错了?

IO6不会调用 – (BOOL)shouldAutorotate

我在我的应用程序中有一些意见,我不想支持方向。 在didFinishLaunchingWithOptions我添加导航: … UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:self.viewController]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; … 在每个ViewController我有UITabBar (我不知道这是否是重要的)。 在第一个视图控制器我添加: -(BOOL)shouldAutorotate { return NO; } – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } supportedInterfaceOrientations在视图加载时被调用,但当我旋转设备时, shouldAutorotate不会调用。 我在这里错过了什么?

AutoLayout uitableviewcell在横向和iPad上计算基于肖像iPhone的高度

我正在学习/试验自动布局和UITableViewCell的。 前几天我问了另一个问题,我回答了我自己的问题,我仍然使用相同的约束/代码。 有关完整的代码,请参阅此处: AutoLayout多行UILabel剪切一些文本 。 在heightForRowAtIndexPath内部缩小它我正在使用一个自定义的UITableViewCell的实例来计算该行所需的高度。 这工作完美的肖像,但是当我切换到横向模式, systemLayoutSizeFittingSize返回单元格的高度相同,如果它是在肖像。 我已经打印出contentView和标签的框架,似乎没有更新。 这样做的结果是迫使标签增长留下了大量的空白。 标签显示在正确的宽度,在横向上,他们按照我的预期布置,如果我硬编码单元格的高度,它完美的作品。 它看起来像这样: 硬编码后(我想看起来像): 更糟糕的是,我在iPad上运行时也得到了相同的结果,甚至是纵向模式,这意味着我获得了iPhone尺寸。 从我所看到的就好像systemLayoutSizeFittingSize没有方向或设备的概念。 我试图伪造单元格的frame ,试着旋转单元格,调用layoutSubviews ,重新加载方向变化的tableView ,似乎没有任何影响。 我错过了一些基本的东西?

方法 – 它仍然被拒绝?

我听说使用[UIDevice setOrientation:]可能是应用程序拒绝应用程序的原因。 有没有有关它的certificate信息?