AutoLayout, Constraints and Animation

后端 未结 3 514
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 04:31

Let\'s assume that I have this UIView:

\"enter

with these relativ

3条回答
  •  庸人自扰
    2021-01-03 05:14

    You can make a placeholder UIView with the ending constraints you want and swap the original constraints with the placeholder UIView constraints.

    That way it keeps the layout constraints in the storyboard and keeps your code from being messy. It also gives you the added effect of seeing the end result of your animation in the preview section of xcode.

    If use the cocoapod "SBP" to do this with just a couple lines. Here's a tutorial.

提交回复
热议问题