我們可以改變NSLayoutConstraint的常量屬性,並且比使用UIView動畫塊更改動畫。ios:自動佈局動畫,如何防止子視圖被動畫?
myLayoutConstraint.constant = 50;
[UIView animateWithDuration: .3 animations:^{
[view layoutIfNeeded];
}];
但是,具有佈局約束作爲其超視圖的視圖的子視圖將會生成動畫!它們將從原始零框架動畫到自動佈局的目標框架。如何解決這個問題呢?