美文网首页
react-native Vibration

react-native Vibration

作者: 东翌编程 | 来源:发表于2017-05-04 17:45 被阅读0次

/**

* Sample React Native App

* https://github.com/facebook/react-native

* @flow

*/

import React, { Component } from 'react';

import {

AppRegistry,

StyleSheet,

Text,

View,

InteractionManager,

PixelRatio,

Vibration

} from 'react-native';

export default class D20170504 extends Component {

render() {

return (

{

/**

* 需要真机测试

* ios 支持一次震动

* android 支持一次和多次震动

*/

}

{

Vibration.vibrate();

}}>{'一次震动'}

{

// 第一个 500 为震动 500 毫秒

// 200 为震动以后间隔 200 毫秒

// 第二个 500 间隔后在震动500 毫秒

Vibration.vibrate([0,500,200,500]);

}}>{'震动模式/android'}

{

//第二个参数为true = 连续/重复震动

Vibration.vibrate([0,500,200,500],true);

}}>{'重复震动/android'}

);

}

}

const styles = StyleSheet.create({

container: {

flex: 1,

justifyContent: 'center',

alignItems: 'center',

backgroundColor: '#F5FCFF',

},

welcome: {

fontSize: 20,

textAlign: 'center',

margin: 10,

},

instructions: {

textAlign: 'center',

color: '#333333',

marginBottom: 5,

},

});

AppRegistry.registerComponent('D20170504', () => D20170504);

相关文章

  • react-native Vibration

    /** * Sample React Native App * https://github.com/facebo...

  • Linear Life

    content 1 Free Vibration to Force Vibration 2 Damping 3 N...

  • 机械单词(一)

    Vibration 振动 Gearbox noise and vibration 变速箱噪声及振动 Broachi...

  • Vibration

    不为了改变而改变,而是升华,让现在的自己变得比现在更好,处事心境更舒适。 考试,我想是这几年来最折磨我又是鼓励我向...

  • Free Vibration

    Content concepts Priciple 案例1: simple pendulem 案例2: simpl...

  • Israel Vibration

    这是一个诞生于牙买加金斯顿的根源雷鬼组合,三位成员Lascelle "Wiss" Bulgin、Albert "A...

  • Vibration API

    大多数现代移动设备包括振动硬件,其允许软件代码通过使设备摇动来向用户提供物理反馈。Vibration API[ht...

  • 甘比拓展写作-the physics of guitar-ng

    Vibration accred by guitar is the big implies for us to h...

  • 2020-05-12:Effect of different v

    文章信息 文献标题:Effect of different vibration frequencies on he...

  • 2020-05-16:Synthesized quantitat

    文章信息 文献标题:Effect of different vibration frequencies on he...

网友评论

      本文标题:react-native Vibration

      本文链接:https://www.haomeiwen.com/subject/suddtxtx.html