弹出模态ViewController、UIModalPresentationStyle和UIModalTransitionStyle

来源:互联网 发布:团队协作工具知乎 编辑:程序博客网 时间:2024/06/06 09:13
////  ViewController.m//  Test////  Created by y on 2016/10/17.//  Copyright © 2016年 NJ. All rights reserved.//#import "ViewController.h"#import "SecondVC.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];    [_toSecodPage addTarget:self action:@selector(tonextPage:) forControlEvents:UIControlEventTouchUpInside];}-(void)tonextPage:(UIButton*)sender{    /*     一:弹出时的动画风格     typedef NS_ENUM(NSInteger, UIModalTransitionStyle) {     UIModalTransitionStyleCoverVertical = 0, //默认的格式     UIModalTransitionStyleFlipHorizontal __TVOS_PROHIBITED,     UIModalTransitionStyleCrossDissolve,     UIModalTransitionStylePartialCurl NS_ENUM_AVAILABLE_IOS(3_2) __TVOS_PROHIBITED,     };     底部滑入,水平翻转进入,交叉溶解以及翻页这四种,在iPhone上也有效。     二:弹出风格     其中的方式在iPad上面统统有效,但在iPhone和iPod touch上面系统始终以UIModalPresentationFullScreen模式显示presented VC。     */    SecondVC * secondVC = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SecondVC"];    secondVC.modalPresentationStyle =UIModalPresentationFullScreen;    //secondVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;    [self presentViewController:secondVC animated:true completion:nil];}@end
阅读全文
0 0