我试图使用这个包来创建一个范围滑块:https://www.npmjs.com/package/react-native-range-slider
import React from 'react';
import { Platform, StyleSheet, Text, View, Image, Switch, Button } from "react-native";
import { createAppContainer } from 'react-navigation';
import DatePicker from 'react-native-datepicker';
import RangeSlider from 'react-native-range-slider';
<View style={{flex: 1, flexDirection: 'row'}}>
<RangeSlider
minValue={0}
maxValue={100}
tintColor={'#da0f22'}
handleBorderWidth={1}
handleBorderColor="#454d55"
selectedMinimum={20}
selectedMaximum={40}
style={{ flex: 1, height: 70, padding: 10, backgroundColor: '#ddd' }}
onChange={ (data)=>{ console.log(data);} }
/>
</View>
然而,一直运行到错误:不变量违反:requireNativeComponent: "RangeSlider"在UIManager中没有找到。
我能够成功地安装包并运行react-native link react-native-range-slider来链接库,但我仍然得到错误。
我在IOS上运行:react-native-cli: 2.0.1和react-native: 0.59.8。
有人能帮我解决这个问题吗?
runpod install在ios目录下,然后重新运行项目。