尝试在 uiscrollview 内部绘制
我们希望能够在 uiscrollview 中显示一张大图片,可以使用两根手指滚动,然后允许用户使用一根手指在其上绘图。
我们已经制作了一个应用程序,您可以在其中显示背景图像,然后在另一个 uiview 上在其顶部进行绘制。我们基本上想将其与 uiscrollview 合并,但我们不确定是否可能/如何做到这一点。如果我们将 uiscrollviews 最小触摸次数设置为 2(就像这里的答案模拟滚动视图内的拖动< /a>),然后我们可以使用touchesBegan、touchesEnded等进行绘制,并在它们内部检查是否是一根手指以及是否是绘制的?
谢谢
We would like to be able to display a large picture inside a uiscrollview which can be scrolled using two finger, and then allow the user to draw on it using one finger.
We've already made an app where you can display a background image and then draw on top of it on another uiview. We basically want to incorporate this with the uiscrollview, but we're not sure if it's possible/how to do that. If we set the uiscrollviews minimum number of touches to 2 (like the answer here Simulating drags inside a scrollview), could we then use touchesBegan, touchesEnded etc for drawing, and inside of them just check to see if it was one finger and if it was draw?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
万一其他人想尝试这个,它确实有效!我们这样做并没有真正遇到任何问题。只要您告诉滚动视图仅响应两个手指操作,它就可以正常工作。
Just in case anyone else wanted to try this, it does work! We didn't really encounter any problems doing this. As long as you tell the scrollview to only respond to two finger actions it works fine.