objective-c - iOS中拖动imageview,怎么设置拖动范围
漂亮男人
漂亮男人 2017-05-02 09:21:31
0
3
719

目前知道怎么自由拖动imageview了,可是不知道怎么才能让它只能在制定范围内拖动呢?求教

漂亮男人
漂亮男人

reply all(3)
習慣沉默

Who come, help me

漂亮男人

This question is also a drunk one. Looking at the username, is the questioner a girl? A little thought on this issue will yield results.

A simple answer:
You need to set a range, and then determine whether it touches the edge based on the position of the imageView. If so, then you are not allowed to continue dragging in that direction.

漂亮男人
既然你知道能拖动,那么在动的时候判断一下是否到了你指定的边缘,要是到了边缘,不让他移动即可。
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!