视图控制器(入门级)
来源:互联网 发布:淘宝联盟怎么满减 编辑:程序博客网 时间:2024/06/07 14:25
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 100, 100, 50)];
button.backgroundColor = [UIColor grayColor];
[self.view addSubview:button];
[button addTarget:self action:@selector(jump) forControlEvents:UIControlEventTouchUpInside];
2.视图跳转
-(void)jump
{
firstViewController *first = [[firstViewController alloc] init];
first.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:first animated:YES completion:^{
NSLog(@"跳转完成");
}];
}
3.视图跳回(第二个视图)
创建按钮
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 100, 100, 50)];
button.backgroundColor = [UIColor redColor];
[self.view addSubview:button];
[button addTarget:self action:@selector(jumpBack) forControlEvents:UIControlEventTouchUpInside];
视图跳回
-(void)jumpBack
{
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"返回完成");
}];
}
- 视图控制器(入门级)
- iOS开发入门_视图控制器_UI_02
- 控制器 & 视图
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- 视图控制器
- iOS入门(二十七)视图控制器UIViewController
- ssh connection in ros
- pycharm中遇到“unresolved reference 'name'..."问题
- Leetcode553. Optimal Division
- creat the publisher and use self-defined message
- zero-shot learning 论文三篇小结
- 视图控制器(入门级)
- 清楚电脑中卸载不干净的垃圾文件
- freeswitch在通道中添加odbc_dsn
- 《简明Python教程》之输入与输出
- 《权限系列shiro+cas》----修改cas的默认登录页
- github入门到上传本地项目
- dpkg命令的用法
- pandas/numpy常用方法/属性
- SYD8801从机和TIcc2540主机进行通讯(通过修改主机端代码实现)