objective-c – 强制UIViewController处于横向模式iOS7

objective-c – 强制UIViewController处于横向模式iOS7,第1张

概述我已经实现了正确的功能,但它们没有被触发?我在StackOverFlow上尝试了几种解决方案,但它们都不起作用.我已经尝试将视图添加到UINavigationController,也不起作用. FakeIDDetailViewController.h: @interface FakeIDDetailViewController : UIViewController@end FakeIDDetai 我已经实现了正确的功能,但它们没有被触发?我在StackOverFlow上尝试了几种解决方案,但它们都不起作用.我已经尝试将视图添加到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;}
解决方法 如果要将视图控制器推送到导航控制器中的其他视图控制器堆栈,则仅需要横向将无法正常工作.您应该以模态方式显示横向约束视图控制器.

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

总结

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

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1000300.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存