【发布时间】:2018-06-11 21:54:17
【问题描述】:
我正在使用 ReactNative panResponder。我把一个 NativeView 嵌套在 View 中。 android NativeView已经处理了gestureEvent,所以ReactNative _panHandlers只需要在iOS中添加即可。
关于这个 _panHandlers ,难道只有这种丑陋的方式来分离ios和Android吗?
if (Platform.OS === 'ios') {
return (<View style={styles.container}
{...this._panResponder.panHandlers}>
<NativeView/>
</View>);
} else {
return (<View style={styles.container}>
<NativeView/>
</View>);
}
有没有类似这种风格的?
<View style={if (Platform.OS === 'ios')?{}:{}} />
“{...this._panResponder.panHandlers}”中的“{...}”是什么意思?
【问题讨论】:
标签: android ios react-native jsx react-native-ios