react-native-touchbar

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/phj_88/article/details/82141752

react-native-touchbar 是用于 react-native-macos 的 touchBar。

import React from 'react';
import { View } from 'react-native-macos';
import TouchBar from 'react-native-touchbar';

export default myApp = () => (
     <View style={styles.container}>
        <TouchBar>
          <Button title="Esc" onClick={() => alert('Hello, vim!')}/>
          <Button title="Courage" style={{ fontSize: 12 }} />
          <View style={{ backgroundColor: 'red', flex: 1}} />
        </TouchBar>
        <Text style={styles.welcome}>
          Welcome to React Native macOS!
        </Text>
        <Text style={styles.instructions}>
          To get started, edit index.macos.js
        </Text>
        <Text style={styles.instructions}>
          Press Cmd+R to reload,{'\n'}
          Or use Developer Menu
        </Text>
     </View>
)

需要 macOS Sierra 10.12.1(12B2657)或更高版本上的 Xcode 8.1,在 Xcode - > Windows 菜单中启用触摸板模拟器:

博主花大量时间和精力整理了大前端最新前端视频教程,省去大家找资源的时间

有兴趣的可以点击下方文字访问博主淘宝网(感谢支持)或直接联系博主QQ:184009766

点击我,支持博主,前端视频教程

猜你喜欢

转载自blog.csdn.net/phj_88/article/details/82141752