
我找到
推动控制器
– (BOol)shouldautorotate没有被调用.
和
– (NSUInteger)supportedInterfaceOrIEntations只被调用一次.
我在xcode的项目摘要(或pList)中正确检查了windows所有方向支持.
我想要调用这些方法,因为有一些uicontrol定位代码,我想以编程方式执行方向更改.
我通过覆盖(类别)导航控制器的以下方法解决了这个问题
-(BOol)shouldautorotate;-(NSUInteger)supportedInterfaceOrIEntations;
我检查了哪个控制器被推入,因此在导航控制器的以下方法中调用了相应的推控制器的uicontrol定位代码
(NSUInteger)supportedInterfaceOrIEntations;
这工作正常,但我不认为这是正确的方法.请帮我解决更好的解决方案.
解决方法 您可以查看以下链接,您需要创建自定义导航以支持自动旋转http://mobileappdevpage.blogspot.in/2012/11/how-to-use-should-autorotateios-6-with.html
另一种方法是通过创建UINaviagationController类来实现
.h文件的代码是
@interface UINavigationController (autorotation)-(BOol)shouldautorotate;-(NSUInteger)supportedInterfaceOrIEntations;
和.m文件的代码是
@implementation UINavigationController (autorotation)-(BOol)shouldautorotate{ UIInterfaceOrIEntation interfaceOrIEntation = [UIApplication sharedApplication].statusbarOrIEntation; [self.topVIEwController shouldautorotate]; return YES;}-(NSUInteger)supportedInterfaceOrIEntations{ return UIInterfaceOrIEntationMaskAll;}@end 总结 以上是内存溢出为你收集整理的iphone – iOS 6 – (BOOL)shouldAutorotate没有被调用导航控制器推送viewControllers全部内容,希望文章能够帮你解决iphone – iOS 6 – (BOOL)shouldAutorotate没有被调用导航控制器推送viewControllers所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)