- (void)viewDidLoad {
[super viewDidLoad];
button1 = [[UIButton alloc]initWithFrame:CGRectMake(50, 50, 100, 50)];
button1.backgroundColor = [UIColor redColor];
[button1 addTarget:self action:@selector(myDemoButton1:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button1];
}
- (void)myDemoButton1:(id)sender{
view2 = [[ViewController2 alloc]init];
// view2 = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController2"];
view2.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:view2 animated:YES completion:nil];
}
ios切换界面
最新推荐文章于 2020-11-11 09:25:11 发布