Touch-Geräte (iOS, Android)
Frage
Gibt es Skala auf den Touch-Eingaben? Ich weiß, es Sensibilität Einstellungen ist zu sagen, wenn Sie oder nicht berühren, aber nicht hat es eine Skala für harten Druck und Niederdruck auch?
Wenn ja, welche Skala ist es? 0 auf 1 oder 0-255 oder was possiblities?
Lösung
Well, that entirely depends on the API. Android, for example, has a getPressure()
accessor in MotionEvents that returns a float between 0.0f and 1.0f, but the actual granularity of your result obviously depends on the hardware - if the screen can only detect "pressed" vs "non-pressed", you will only ever get 0.0f or 1.0f.
EDIT: As per Julio Gorgé's answer, iOS does not offer this functionality.
Andere Tipps
EboMike already answered correctly your question regarding Android devices. For iOS, I can say it does not expose touch pressure information through public APIs at this moment.
There's a workaround for iOS. See my answer in Tap pressure strength detection using accelerometer