ios学习笔记—— 模态视图
来源:互联网 发布:linux tomcat 慢 编辑:程序博客网 时间:2024/06/05 11:12
模态视图:一个窗口或页面,当它出现时,整个窗口只能对它进行操作。例如登陆是出现的点注册出现的窗口。
主要方法:
呈现模态视图:presentViewController: animated: completion: ^
关闭模态视图:dismissViewControllerAnimated: completion:^
需要在stroyboard中添加一个viewController,并添加一个modalView类,设置号它的控制类和ID。
相关代码如下:
打开(MainViewController 中方法)
- (IBAction)go:(id)sender { UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *modalViewController = [mainStoryboard instantiateViewControllerWithIdentifier:@"ModalView"]; [self presentViewController: modalViewController animated:YES completion:^{ }];}
关闭(ModalViewController 中方法)
- (IBAction)back:(id)sender { [self dismissViewControllerAnimated:YES completion:^{ }];}
0 0
- ios学习笔记—— 模态视图
- iOS学习笔记——滚动视图(scrollView)
- iOS学习笔记——表视图一(创建)
- iOS学习笔记——表视图二(编辑)
- iOS学习笔记——表视图三(搜索)
- iOS学习笔记——视图上移与键盘弹回
- iOS学习笔记——视图上移与键盘弹回
- iOS学习笔记——滚动视图(scrollView)
- iOS学习笔记——视图上移与键盘弹回
- iOS学习笔记——视图上移与键盘弹回
- iOS学习笔记——视图上移与键盘弹回
- iOS学习笔记——滚动视图(scrollView)
- iOS开发学习笔记——分段视图(UISegmentedControl)
- iOS学习笔记-025.UIPickerView——数据选择视图
- iOS学习笔记-003.视图 & 视图控制器
- iOS集合视图学习笔记
- iOS 学习笔记 视图切换
- MySQL学习笔记—视图
- mysql数据库管理员口令丢失的处理方法
- 黑马程序员——java基础(IO部分知识梳理)上
- LeetCode Solutions : Minimum Path Sum
- STL源码剖析读书笔记
- 成功Implementating CRM为例
- ios学习笔记—— 模态视图
- 成为展会商务之星
- Pinterest用“引导式搜索”挑战谷歌?
- hdu 2222(Keywords Search) (AC自动机)
- 图片从右到左边渐进显示
- 尝试新的Firefox的JavaScript引擎中的JaegerMonkey每晚构建
- Python中操作MySQL中timestamp时间属性
- 关于数位dp
- 挂载分区时提醒 mount: you must specify the filesystem type