react-native - 如何忽略对反应本机模式的拖累
问题描述
我正在使用包含颜色选择器的标准 React Native Modal:react-native-wheel-color-picker。
问题是移动颜色选择器时的拖动事件被模式拾取,并且它弄乱了用户交互。
<Modal
presentationStyle="pageSheet"
animationType="slide"
visible={showCreate}
>
<View style={styles.modalView}>
<View style={{marginBottom: 10, paddingVertical: 20, flexDirection: "row", justifyContent: "space-between", borderBottomColor: "#ccc", borderBottomWidth: 1}}>
<TouchableOpacity onPress={() => setShowCreate(false)}>
<Text style={{fontSize: 17}}>Cancel</Text>
</TouchableOpacity>
<Text style={{fontSize: 17, fontWeight: "bold"}}>
Create Tag
</Text>
<Text style={{fontSize: 17}}>
Save
</Text>
</View>
<CreateTag />
</View>
</Modal>
颜色选择器在元素中:
<View style={{flex: 1}}>
<ColorPicker
// ref={r => { this.picker = r }}
// color={this.state.false.state.swatchesOnly}
onColorChange={c => (c) = setColor(c)}
// onColorChangeComplete={this.onColorChangeComplete}
thumbSize={30}
sliderSize={20}
// noSnap={false}
// row={true}
// swatchesLast={this.state.swatchesLast}
swatches={false}
discrete={true}
/>
</View>
有没有办法阻止模态拾取拖动事件?
谢谢
解决方案
推荐阅读
- c# - c#asp.net如何为只读剃须刀制作下拉列表
- llvm - llvm 传递到展平(一些)嵌套循环
- javascript - Javascript:如何向数组添加值?
- java - 如何在 Spring 中指定 bean 的“id”属性?
- selenium - 使用 Selenium Grid 进行并行测试时,maxSession 和 maxInstances 有什么区别
- java - 在 Wildfly 中为 MDB 创建队列
- python - 如何在 for 循环的上下文中使用 __next__ 方法?
- objective-c - SwiftUI 的 Canvas 不会出现在 Objective-C 项目中
- docker - Docker(节点:8.15-alpine)+ Chromium + Karma 单元测试不起作用
- python - Dronekit 上传到 Pixhawk 4 - 舍入问题