在ios中使用平移手势时有没有办法退出当前视图组?
因此,我的屏幕底部有一个水平滚动视图,其中包含子视图。我想从底部拖动视图并将其捕捉到顶部的定义位置。但是,拖动视图时,它仅在滚动视图内移动。有没有办法退出滚动视图并获取其外部的视图?
应用程序的布局(我想从底部取出项目并将它们捕捉到顶部的位置):
So I have a horizontal scroll view at the bottom of my screen which contains child views. I would like to drag a view from the bottom and snap it to a defined position on the top. But while dragging the view, it only moves about inside the scroll view. Is there any way to exit the scrollview and get the view outside it?
Layout of the app (I want to take the items from the bottom and snap them to the positions on top):
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您尝试通过拖动移动视图坐标时,它只会在其超级视图(即底部滚动视图)上移动。
如果您想将按钮拖到滚动视图之外,那么您需要在这里使用一个技巧。
看起来就像您在主屏幕上拖动了相同的按钮,但在幕后却有不同的逻辑。
When you try moving views coordinates with drag, it will only move on its superview, i.e. your bottom scroll view.
If you wanted to drag your button outside of your scroll view then you need to have a trick here.
It will look like you dragged the same button on main screen but under the hood it was a different logic.