保持手在屏幕上用数字笔在ipad / iphone上书写 [英] Writing with digital pen on ipad/iphone by keeping hand on screen

查看:113
本文介绍了保持手在屏幕上用数字笔在ipad / iphone上书写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在iphone和ipad上使用笔触在绘图应用程序上工作。到目前为止,我已经实现了基本绘图并使用数字笔进行了测试,并且可以正常工作,但是在使用iphone / ipad进行绘图时,如果我的手指在触摸笔之前触摸了屏幕,则笔将无法正常工作,我想要实现的是,即使我的手指正在触摸ipad屏幕,我也希望能够用笔书写。

I am working on a drawing app, with pen touch, on iphone and ipad. Till now , I have implemented the basic drawing and tested with digital pen and it work fine, but I have one issue, while drawing on iphone/ipad, if my fingers touch the screen before I draw with pen , the pen wont work, So what I want to achieve is that, I want to able to write with pen, even if my fingers are touching the ipad screen.


Ranjit作为礼物

Regards Ranjit

推荐答案

由于手写笔应该模仿手指的触摸,因此无法区分手指和手写笔。您要么必须做出使所有触摸都画出(包括在屏幕上的手),要么只有第一个触摸屏幕的手指才能画出(这意味着您必须在手之前将手写笔放在屏幕上)可以触摸它。)

There is no way to differentiate between a finger and a stylus, as a stylus is supposed to emulate a touch from a finger. You will either have to make it so that all touches draw (including a hand on the screen) or make it so only the first "finger" that touches the screen can draw (meaning that you must put the stylus on the screen before your hands can touch it).

@iLive在提及您应实现的那些委托方法时是正确的,但我认为您已经在使用这些方法。

@iLive is correct in mentioning those delegate methods that you should implement, but I assume that you are already using these methods.

跟踪特定的触摸就像在touchesBegan期间将其实例的地址添加到数组一样简单。将它们附加到CFMutableArrayRef。然后,在touchesMoved方法中,您只需按顺序获取触摸的索引。

Tracking specific touches is as simple as adding the addresses of their instances to a array during touchesBegan. Append them to a CFMutableArrayRef. Then, in the touchesMoved method, you can simply get the index of the touch in order.

这篇关于保持手在屏幕上用数字笔在ipad / iphone上书写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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