触感反馈,十分短的震动效果,放在执行函数里面就好了(按钮、下拉刷新…交互很舒服)
var UIImpactFeedbackGenerator = plus.ios.importClass('UIImpactFeedbackGenerator');
var impact = new UIImpactFeedbackGenerator();
impact.prepare();
impact.init(1);
impact.impactOccurred();
uni短震动api(15ms)
uni.vibrateShort({
success: function () {
console.log('success');
}
});
长震动(400ms)
uni.vibrateLong({
success: function () {
console.log('success');
}
});