Can the iPhone detect the size of a touch?

后端 未结 4 1913
陌清茗
陌清茗 2021-02-01 10:17

As far as I can tell the iPhone multitouch framework sends the location of each touch but not the size.

I want to allow the user to tap a button with the tip of their th

相关标签:
4条回答
  • 2021-02-01 10:25

    All these answers are wrong. The fact that Apple doesn't appear to sanction this in apps on the store is a different matter.

     float vf = 10.0; 
     id valFloat = [thisTouch valueForKey:"pathMajorRadius"]; 
     if(valFloat != nil) {
       vf = [valFloat floatValue]; 
     }
    

    I really wish that this issue would get pushed harder by users and developers.

    0 讨论(0)
  • 2021-02-01 10:31

    Since UITouch handles the touch and nothing is said about the size, i'd say no you can't. You better try another approch like a drag..

    0 讨论(0)
  • 2021-02-01 10:44

    No, that is not possible using UIKit.

    0 讨论(0)
  • 2021-02-01 10:48

    I'm fairly sure that the hardware gets a very accurate read of the touched area, but the iPhone firmware does not bring this information to the developer. As CiNN said, UITouch just doesn't provide this information.

    However, the hardware is the same as in the old Fingerworks.com products which really did provide the actual touch data to the developer. So perhaps in a (much) later OS release, touch surface profiles would be provided. it might be useful!

    0 讨论(0)
提交回复
热议问题