Touch and pull down a view

后端 未结 3 2007
终归单人心
终归单人心 2020-12-28 11:16

I have a uiview at the top of the interface (below the status bar) that only the bottom part of it is shown.

Actually, I want to make the red uiview to slide down

3条回答
  •  天涯浪人
    2020-12-28 11:53

    Refer to my answer in iPhone App: implementation of Drag and drop images in UIView

    You just need to use TouchesBegin and TouchesEnded methods. In that example, I have shown how to use CGPoint, Instead of that you have to try to use setFrame or drawRect for your view.

    As soon as TouchesMoved method is called you have to use setFrame or drawRect (not sure but which ever works, mostly setFrame) also take the height from CGPoint.

提交回复
热议问题