【问题标题】:Is it possible to control vibration intensity with React Native?是否可以使用 React Native 控制振动强度?
【发布时间】:2021-05-26 14:47:32
【问题描述】:

我正在使用 React Native 开发一个 Android 应用。

我想控制Android手机的振动强度,但我在API doc找不到路。

有什么方法可以用 React Native 控制振动强度?

【问题讨论】:

    标签: android react-native vibration


    【解决方案1】:

    我认为没有办法控制强度。我认为振动是打开或关闭。但是,您应该能够通过使用不同的振动模式来模拟不同的强度。 例如,光强度振动可能如下所示:

    Vibration.vibrate([15,1], true);
    

    剧烈的振动模式可能看起来像:

    Vibration.vibrate([10,5], true);
    

    其中数组中的第一项是分离持续时间,数组中的第二项是振动持续时间,true 值告诉方法重复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-26
      • 2021-02-11
      • 1970-01-01
      • 2021-06-22
      • 2017-07-22
      相关资源
      最近更新 更多