iOS之 Auto Layout

1. 动画

// 修改从 StoryBoard 绑定到类的约束的值
self.boxView.constant += 80

// 在动画闭包里对其父级进行 layoutIfNeeded()
UIView.animateWithDuration(0.5, animations: { () -> Void in
    self.view.layoutIfNeeded()
})

 2. frame的确定

viewDidLoad
viewWillAppear
viewWillLayoutSubviews
viewDidLayoutSubviews // frame 确定
viewDidAppear
viewWillDisappear
viewDidDisappear

3. why?  

 

posted @ 2016-01-12 23:13  OHeroJ  阅读(156)  评论(0编辑  收藏  举报