请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

老师求帮助,ScrollableTabView Listener is not supported for native driven events

老师,我导入ScrollableTabView后,刚开始报错:ViewPropTypes没有定义。

然后我把ScrollableTabView里面报错的文件的propTypes里面的ViewPropTypes改成View.propsTypes,

重启运行后报错:Listener is not supported for native driven events。

这个问题应该怎么解决?

正在回答 回答被采纳积分+3

2回答

慕哥821572 2018-11-05 18:38:21

应该是版本问题,目前安装react-native-scrollable-tab-view的最新版本是0.9.0,我也碰到这个问题,琢磨了半天也没解决。老师的代码是0.7.0版本的,所以就降级安装了0.7.0版本,能够正常运行了。版本问题也是很头疼的事情,希望老师能尽早解决0.9.0版本的兼容问题

安装0.7.0版本:

npm install react-native-scrollable-tab-view@0.7.0 --save

0 回复 有任何疑惑可以回复我~
CrazyCodeBoy 2017-06-23 09:31:37

导入ScrollableTabView应该不会报ViewPropTypes没有定义的错误,看一下你导入和使用它的方式是否正确呢:

可参考:

导入:

import ScrollableTabView, {ScrollableTabBar} from 'react-native-scrollable-tab-view'

使用:

<ScrollableTabView
    tabBarUnderlineStyle={{backgroundColor: '#e7e7e7', height: 2}}
    tabBarInactiveTextColor='mintcream'
    tabBarActiveTextColor='white'
    ref="scrollableTabView"
    tabBarBackgroundColor={this.state.theme.themeColor}
    initialPage={0}
    renderTabBar={() => <ScrollableTabBar style={{height: 40, borderWidth: 0, elevation: 2}}
                                          tabStyle={{height: 39}}/>}
>
    {this.state.languages.map((reuslt, i, arr)=> {
        let language = arr[i];
        return language.checked ? <PopularTab key={i} tabLabel={language.name} {...this.props}/> : null;
    })}
</ScrollableTabView>

另外:

按照提示的路径文件进行一些修改

https://img1.sycdn.imooc.com//szimg/5b46c6d30001488612280986.jpg


0 回复 有任何疑惑可以回复我~
  • 我也遇到相同的问题,请问到底有什么方式去解决吗
    回复 有任何疑惑可以回复我~ 2018-01-27 23:23:20
  • 升级react-native-scrollable-tab-view到最新版试一下
    回复 有任何疑惑可以回复我~ 2018-01-29 10:01:32
  • 从昨天就遇到和题主一样的问题,也是改View.propsTypes,然后报Listener is not supported for native driven events的错误。
    我使用npm install react-native-scrollable-tab-view --save应该就是使用最新版的了吧,"^0.8.0"。希望老师能解答一下
    回复 有任何疑惑可以回复我~ 2018-07-11 22:09:57
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信