iOS开发技巧——Autolayout动画

 

 

 

使用Autolayout时需要在动画的代码前面后面添加

layoutIfNeeded方法

Animation

AutoLayout也可以配合传统的animation方法,整体代码结构如下。

   1:  [self.view layoutIfNeeded]; 
   2:  [UIView animateWithDuration:0.3f 
   3:                   animations:^{ 
   4:                      //... update constraints    
   5:                     [self.view layoutIfNeeded]; 
   6:                   }]; 

 

 

x

posted @ 2015-04-17 00:30  有奈了  阅读(673)  评论(0编辑  收藏  举报