react-native-touchbar 介绍
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
菜单中启用触摸板模拟器:
TODO:
-
不同于原生的 TouchBarItems(像分段控件)
-
Inner touchbar
-
定制化
-
每个 APP 有多个 Touchbar 实例
react-native-touchbar 官网
https://github.com/ptmt/react-native-touchbar
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。