“Push” animation in Objective-C

后端 未结 3 1896
名媛妹妹
名媛妹妹 2021-02-09 01:30

I have two views: A and B. A is positioned at the top of the screen, B is positioned at the bottom of the screen.

When the user presses a button, view B animates upward

3条回答
  •  粉色の甜心
    2021-02-09 01:42

    You can try followin algorythm:

    1)Put A and B in UIView(i.e UIview *gropedView)

    2)Change B.y till it will be equal A.y+A.height(so B will be right under the A)

    3)Animate groupedView

提交回复
热议问题