iOS   发布时间:2022-05-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了objective-c – 强制UIViewController处于横向模式iOS7大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我已经实现了正确的功能,但它们没有被触发?我在StackOverFlow上尝试了几种解决方案,但它们都不起作用.我已经尝试将视图添加到UINavigationController,也不起作用. FakEIDDetailViewController.h: @interface FakEIDDetailViewController : UIViewController @end FakEIDDetai
我已经实现了正确的功能,但它们没有被触发?我在StackOverFlow上尝试了几种@L_262_1@案,但它们都不起作用.我已经尝试将视图添加到UINavigationController,也不起作用.

FakEIDDetailViewController.h:

@interface FakEIDDetailViewController : UIViewController
@end

FakEIDDetailViewController.m:

@interface FakEIDDetailViewController ()

-(BOOL)shouldAutorotate
{
    return NO;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (UIInterfaceOrientationMaskLandscapeLeft);
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeLeft;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeLeft;
}

- (NSUInteger) application:(UIApplication *)application     supportedInterfaceOrientationsForWindow:(UIWindow *)window {
    return UIInterfaceOrientationLandscapeLeft;
}

解决方法@H_874_32@
如果要将视图控制器推送到导航控制器中的其他视图控制器堆栈,则仅需要横向将无法正常工作.您应该以模态方式显示横向约束视图控制器.

有关示例项目,请参阅此处的答案:
https://stackoverflow.com/a/16022631/983912

大佬总结

以上是大佬教程为你收集整理的objective-c – 强制UIViewController处于横向模式iOS7全部内容,希望文章能够帮你解决objective-c – 强制UIViewController处于横向模式iOS7所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。