Is there any way at all that I can tell how hard the screen is being pressed

前端 未结 4 2152
谎友^
谎友^ 2020-11-30 22:11

I want to find the pressure of the touch. I just don\'t know how to accomplish that result with out jailbreaking it and getting the raw touch data. Does anyone know How I wo

4条回答
  •  余生分开走
    2020-11-30 22:41

    In iOS 3.2 and 4.0 you can get the value more directly like this:

    UITouch* touch = ...// get the touch object
    float radius = [[touch valueForKey:@"pathMajorRadius"] floatValue];
    

    Still not App Store approved, but handy for custom stuff.

提交回复
热议问题