核心图形绘制和删除触摸 [英] Core Graphics Line drawing and deleting on touch

查看:100
本文介绍了核心图形绘制和删除触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个iPhone应用程序有点像在appstore上拿起stick应用程序。我已经做了绘制多行,并使用CoreGraphics显示它。但现在我被困在如何删除线当用户点击它。我在Google上搜索了很多,但没有发现任何相关的。

I am writing an iPhone application somewhat like pick up sticks app on appstore. I have already done with drawing multiple lines and displaying it using CoreGraphics. But now I am stuck with how to delete the line when the user taps on it. I have searched on Google a lot but didn't find anything related.

我已经在别的地方看到你的这个帖子,这真的帮助了我。但问题是
,如果我有一个棒,然后另一根棍子在它的顶部。
当我点击下面的棒,它不应该被删除,如果我点击上面的,应该会被删除,如果没有棍子上面它。如何实现这个东西..我需要存储的路径,即我的行是UIBeizerpath在一个列表,数组,字典任何,请帮助我这个东西。我没有找到任何东西。

I have seen this post of yours at some other place and this has really helped me out. but the problem is that if i have a stick and then another stick on top of it. when i click on the stick which is below, it should not get deleted and if i tap on the above on, it should get deleted if there is no stick above it. How to achieve this thing.. A lso i need to store the paths i.e. my lines which is UIBeizerpath in a list, array, dictionary whatever, please help me with this thing also. I'm not finding anything for it.

推荐答案

如果你在UIView中使用Core Graphics,删除任何内容。你将能够完全重新绘制视图,但也许少一个棍子。

If you are using Core Graphics in a UIView, you won't have to delete anything. You will instead have be able to completely redraw the view, but perhaps with one less stick.

这篇关于核心图形绘制和删除触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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