美文网首页
addChildViewController

addChildViewController

作者: 月咏蝴蝶 | 来源:发表于2015-12-13 19:34 被阅读574次

UIViewController:addChildViewController
我们在使用addSubview时,同时调用[self addChildViewController:child]方法将sub view对应的viewController也加到当前ViewController的管理中。
对于那些当前暂时不需要显示的subview,只通过addChildViewController把subViewController加进去。
需要显示时再调用
transitionFromViewController:toViewController:duration:options:animations:completion方法。
另外,当收到系统的Memory Warning的时候,系统也会自动把当前没有显示的subview unload掉,以节省内存。
另外:
-(void)scrollViewDidScroll:(UIScrollView *)scrollView;
scrollView.contentOffset.x/y 的变化,随着用户拖动的速度,数值变化趋势不一样(也就是说,大力拖动,数值变化大;缓慢拖动,数值趋于逐像素递增or递减)

相关文章

网友评论

      本文标题:addChildViewController

      本文链接:https://www.haomeiwen.com/subject/mgfuhttx.html