Auto Layout constraint change does not animate

强颜欢笑 提交于 2019-11-28 23:50:50

I found the answer.

Instead of,

[settingsView layoutIfNeeded];

this line made it worked like charm,

[self.view layoutIfNeeded];

I suppose we need to perform layoutIfNeeded method on the parent view not just the view we are trying to animate.

UPDATE: As pointed out in a comment by codyko, this is required for iOS 7, iOS 10. For iOS 8 this issue does not exists.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!