我用来呈现视图控制器的代码
VIEwController *vc = [self.storyboard instantiateVIEwControllerWithIDentifIEr:@"VC"]; vc.modalPresentationStyle = UIModalPresentationFormSheet; [self presentVIEwController:vc animated:YES completion:nil];
我正在使用的代码允许显示视图控制器的方向:
- (UIInterfaceOrIEntationMask)supportedInterfaceOrIEntations { return UIInterfaceOrIEntationMaskAll;}- (BOol)shouldautorotatetoInterfaceOrIEntation:(UIInterfaceOrIEntation)toInterfaceOrIEntation{ return YES;}
你管应用程序在播放视频时提供相同的功能,任何想法它是如何工作的?
任何帮助都会感谢,谢谢.
解决方法 AppDelegate.m- (UIInterfaceOrIEntationMask)application:(UIApplication *)application supportedInterfaceOrIEntationsForWindow:(UIWindow *)window {if(_isAllModes) return UIInterfaceOrIEntationMaskAll;else return UIInterfaceOrIEntationMaskPortrait;}
你的VIEwController.回转:
[(AppDelegate*)([UIApplication sharedApplication].delegate) setIsAllModes:YES];NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrIEntationPortrait];[[UIDevice currentDevice] setValue:value forKey:@"orIEntation"];总结
以上是内存溢出为你收集整理的ios – 旋转呈现的视图并锁定呈现视图控制器的方向全部内容,希望文章能够帮你解决ios – 旋转呈现的视图并锁定呈现视图控制器的方向所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)