how to set iPhone vibrate length?

我怕爱的太早我们不能终老 提交于 2019-12-08 00:57:07

问题


I'm using AudioServicesPlaySystemSound to call vibrate function:

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

is there any way to set the duration of the vibrate? i know that the default duration is 0.4 seconds but i want sometimes to make the device vibrate less or more time then this.


回答1:


You can use these numbers for less vibration.

AudioServicesPlaySystemSound(1519); // Weak 
AudioServicesPlaySystemSound(1520); // Strong

You can merge two-three vibration for more vibration duration.




回答2:


I do not think its possible to alter that vibration duration.. Even if you achieve it using some library but I do not think Apple will be happy about that. There are chances of rejection of your App..




回答3:


You are not allowed to change the duration of vibration. If you want more you'd have to set it to start vibrating immediately after the first finishes, but Apple has been known to reject for that.



来源:https://stackoverflow.com/questions/10570553/how-to-set-iphone-vibrate-length

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!