1.页面旋转
现在想要设置当前控制器view支持不支持旋转,需要设置两个相关方法。
<span style="font-size:18px;">-(BOOL)shouldAutorotate
{
return YES;
}</span>
第一个方法如上,决定当前页面是否支持旋转功能。
<span style="font-size:18px;">-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortrait;
}</span>
第二个方法如上,决定当前页面支持几种旋转功能
2.Model方法跳转页面
6.0之前使用
<span style="font-size:18px;">- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated NS_DEPRECATED_IOS(2_0, 6_0);</span>
6.0之后开始使用新的方法
<span style="font-size:18px;">UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
UIViewController *deVc = [board instantiateViewControllerWithIdentifier:@"ViewController"];
[self presentViewController:deVc animated:YES completion:^{
NSLog(@"success");
</span>
关于页面跳转时的动画效果,需要在前往页面中设置
<span style="font-size:18px;">[self setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];渐变</span>
<span style="font-size:18px;">[self setModalTransitionStyle:UIModalTransitionStyle<span style="font-family: Arial, Helvetica, sans-serif;">];翻转</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="font-size:18px;">[self setModalTransitionStyle:UIModalTransitionStylePartialCurl];翻半页</span></span>
<span style="font-size:18px;">[self setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; 底部向上默认画面</span>