iOS视图切换相关总结

本文详细介绍了iOS中通过UIViewController的presentModalViewController:animated:方法进行视图切换的技术细节,包括其如何创建视图控制器间的父子关系及不同设备上的显示效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载自

http://www.devdiv.com/home.php?mod=space&uid=13654&do=blog&id=6380


iOS视图切换相关总结

已有 130 次阅读 2011-11-14 19:50 |个人分类:学习笔记| iOS视图切换

/*
 * 个人笔记,如果有误,请站内PM。或
 *  lxs_lover520#qq#com
 */
      目前,iOS中视图切换主要存在两种方式:基于UINavigationController的pop和push方式以及采用UIViewController的presentModalViewController方式。
     第一种方式.......(请参考网络上各种文章)
     这里谈谈第二种方式,在帮助文档中提到:
When you present a view modally using the presentModalViewController:animated: method, the view controller animates the appearance of the view using the technique you specify. (You can specify the desired technique by setting the modalTransitionStyle property.) At the same time, the method creates a parent-child relationship between the current view controller and the modal view controller.
   也就是说,使用presentModalViewController:animated:方法来实现视图切换的同时,也在当前视图控制器以及模态视图控制器之间构造了父子关系。(以前没有意识到这点)
   其次,帮助文档中还提及: modalViewController is always presented full screen. On iPad, the presentation depends on the value in the modalPresentationStyle property.(在iPhone和iPod设备上,modalViewController的视图一直时铺满整个屏幕的。而在iPad设备上则取决于modalPresentationStyle属性)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值