react-ative-touchbar是用于react-ative-macos的touchBar。
import React from 'react';import { View } from 'react-ative-macos';import TouchBar from 'react-ative-touchbar';export default myApp = () => ( <View style={styles.cotaier}> <TouchBar> <Butto title="Esc" oClick={() => alert('Hello, vim!')}/> <Butto title="Courage" style={{ fotSize: 12 }} /> <View style={{ backgroudColor: 'red', flex: 1}} /> </TouchBar> <Text style={styles.welcome}> Welcome to React Native macOS! </Text> <Text style={styles.istructios}> To get started, edit idex.macos.js </Text> <Text style={styles.istructios}> Press Cmd+R to reload,{'\'} Or use Developer Meu </Text> </View>)需要macOSSierra10.12.1(12B2657)或更高版本上的Xcode8.1,在Xcode->Widows菜单中启用触摸板模拟器:
TODO:
不同于原生的TouchBarItems(像分段控件)
Iertouchbar
定制化
每个APP有多个Touchbar实例
评论