您的位置:首页 > 移动开发 > IOS开发

iOS AutoLayout Constraint如何实现动画效果

2015-01-21 10:41 465 查看
参考苹果官方文档 (See example in "Animating
Changes Made by Auto Layout" section)
 [self.m_pContentBoxView.superview setNeedsUpdateConstraints];    [UIView animateWithDuration:0.5 animations:^{        self.m_pContentLeftConstraint.constant = changeX;        [self.m_pContentBoxView.superview layoutIfNeeded];//最后使用layoutifneeded方法来从新定义约束,并且产生动画    }];[/code]
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: