iOS画线时,两个箭头都带有起点和终点,而手指触摸终点并从起点或终点旋转 [英] iOS draw line with both arrow with start-end point while finger touch end and rotate from start or end point

查看:221
本文介绍了iOS画线时,两个箭头都带有起点和终点,而手指触摸终点并从起点或终点旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助制作绘图演示。

I need help making a drawing demo.

当用户用手指画一条线时,
的两端都有方向箭头。
松开手指时,会用
? (问号)在行中心。

When the user draws a line using their finger, the line has directional arrows on both ends. When their finger releases, it draws the line with "?" (question-mark) in center of the line.

然后,当用户点击?时,它将显示一个新视图,用户可以输入
的值,并且该值在该行中。

Then, when user taps on the "?", it will show a new view and the user can enter a value, and the value is in that line.

我们可以在捕获图像上添加多行,也可以删除
选定的行。

And we can add multiple lines on capture-image and also we can delete selected line.

我不知道如何开始开发这些功能,因此
请给我一个想法或任何链接,或者建议开始开发此
功能。

I don't understand how can I start developing these features so please give me an idea or any link, or suggestion to start develop this feature.

推荐答案

您应该使用 UITapGestureRecognizer UIBezierPath 。这样做的目的是使人在某一点上点击,然后在第二点上点击,然后在两点之间创建一个UIBezierPath。要获得中间的问号,您可以使其从第一点到第二点(点1和点2之间的距离-20pt的一半)。然后对该行的另一半进行相同操作(这样您现在在该行的中间就有一个空格。

You should use a UITapGestureRecognizer and a UIBezierPath. Have it so that person taps at one point and then taps at a second point, then make a UIBezierPath between the two points. To get the question mark in the middle you could make it so that the line goes from the first point to (half the distance between point 1 and point 2 - 20pt). And then do the same with the other half of the line (so that you now have a space in the middle of the line.

这篇关于iOS画线时,两个箭头都带有起点和终点,而手指触摸终点并从起点或终点旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆