【问题标题】:Issue with Range slider范围滑块问题
【发布时间】:2021-07-30 07:21:01
【问题描述】:

我正在尝试使用这个包来创建一个范围滑块: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>

但是一直遇到错误:Invariant Violation: requireNativeComponent: "RangeSlider" was not found in UIManager.

我能够成功安装包并运行 react-native link react-native-range-slider 来链接库,但我仍然收到错误。

我在 IOS 上运行:react-native-cli: 2.0.1 和 react-native: 0.59.8。

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: ios react-native react-redux react-native-ios


    【解决方案1】:

    在 ios 目录中运行 pod install 然后重新运行项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-22
      • 1970-01-01
      • 1970-01-01
      • 2018-11-21
      • 2011-02-10
      • 2014-12-26
      • 1970-01-01
      相关资源
      最近更新 更多