How to animate while resizing UIView

前端 未结 4 1981
一整个雨季
一整个雨季 2021-01-31 20:30

I saw some material on the web, but still can\'t quite get to where I want. I need to animate my view downwards, making it\'s height bigger.

Here is my code so far. What

4条回答
  •  自闭症患者
    2021-01-31 20:46

    clipsToBounds is the solution.

    Explanation: clipToBounds is a property that specifies if subviews should be cropped or not. So if a subview is bigger than its superview it will be cropped if you set "superview.clipToBounds=YES". In the case of this post the superview WAS resized but there was no visible difference for the user, because subviews were drawn even if they were outside of the frame.

    It's a little bit tricky, because there is no visible link with the animation, but that's why THIS property makes the difference.

提交回复
热议问题