react-native - 如果多次使用,反应原生色轮不起作用
问题描述
我在常规安装时遇到了Invariant Violation问题,因此我将脚本作为组件导入并像下面这样使用它
import ColorWheel from '../../components/ColorWheel';
<View style={{flexDirection:'row', justifyContent: 'center'}}>
<View style={{width:'50%', paddingHorizontal: 5}}>
<Label style={{fontSize: 14, fontWeight: 'bold', paddingVertical: 5, textAlign: 'center'}}>COLOR (IF Any)</Label>
<ColorWheel
initialColor="#ffffff"
onColorChange={color => this.onColorChange(color)}
thumbStyle={{ height: 30, width: 30, borderRadius: 30}}
style={{ height: 180, width: 180, elevation: 100000}}
/>
</View>
</View>
<View style={{flexDirection:'row', justifyContent: 'center'}}>
<View style={{width:'50%', paddingHorizontal: 5}}>
<Label style={{fontSize: 14, fontWeight: 'bold', paddingVertical: 5, textAlign: 'center'}}>COLOR (IF Any)</Label>
<ColorWheel
initialColor="#ffffff"
onColorChange={color => this.onColorChange1(color)}
thumbStyle={{ height: 30, width: 30, borderRadius: 30}}
style={{ height: 180, width: 180, elevation: 100000}}
/>
</View>
</View>
如果单次使用效果很好,但我需要多次使用(5 种不同颜色使用 5 次)。然后它停止工作,如果单击图像或尝试拖动拇指,则不会发生任何事情。
提前致谢。
解决方案
推荐阅读
- sonata-admin - Symfony 3.4 - SonataUser - Twig - 空白页
- javascript - Google App Script emailing entire workbook as opposed to a single sheet
- c# - C#,并行 For 循环内部的 For 循环无法正常工作
- javascript - 通过在 Symfony 4 中切换引导模式来编辑行
- angular - 在ionic3 / angular5中同步调用App组件
- php - 数组转换删除索引
- php - 如何将数据附加到word文件php codeigniter?
- php - 将onclick url存储在mysql表中并在php页面上获取
- html - 如何正确导入 font-awesome scss
- swift - Mac OS - 更改状态项按钮图像