我明白那个这个回应明确指出,如果没有私有函数调用,这是不可能的。因此,根据苹果的条款,这种方式不能在App Store应用程序上使用。
然而,一些应用程序似乎已经使用了这个函数调用:
-
倒数第二个用于实际防手掌误触,无需像 Note Taker HD 中那样预定义拒绝区域
- 压力敏感度大师,他们称之为“TrueVelocity 2”
- GarageBand 还具有压力灵敏度
显然,尽管苹果有限制,但这种方法已经在 App Store 应用程序中广泛使用。
tl;driOS 上获取触摸尺寸的私有函数调用是什么?
使用 iOS8,您可以访问touch.majorRadius
属性,这是一个CGFloat
,以 10.45 的倍数增长,并与触摸区域的半径(以毫米为单位)成正比。 touch.majorRadiusTolerance 是可与 iOS8 一起使用的第二个属性,它给出了触摸半径信息的准确性。根据我的测量,它总是一半majorRadius
一步的大小。
iPad Pro 的触摸屏灵敏度提高了三倍,可以接收 Apple Pencil 发出的微弱信号,该信号低于旧款 iPad 型号的报告阈值。 Pencil 的触摸半径报告为 0.25,而即使是最轻微的手指接触也会报告为 20.84 或更大。
在 UIView 方法中像这样使用它:
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
// Regular multitouch handling.
[super touchesBegan:touches withEvent:event];
CGPoint center = [touch locationInView:self];
NSLog(@"Touch detected at %6.1f | %6.1f", center.x, center.y);
CGFloat radius = [touch majorRadius];
NSLog(@"Radius = %5.1f; lower limit = %5.1f; upper limit = %5.1f", radius, radius-touch.majorRadiusTolerance, radius+touch.majorRadiusTolerance);
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)