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

来源:5-3 Popular(最热)模块的列表页面实现-2

人在塔在_0001

2017-06-22

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

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

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

这个问题应该怎么解决?

写回答

2回答

慕哥821572

2018-11-05

应该是版本问题,目前安装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
0

CrazyCodeBoy

2017-06-23

导入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>

另外:

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

//img.mukewang.com/szimg/5b46c6d30001488612280986.jpg


0
6
Mr_Chansheng
回复
CrazyCodeBoy
从昨天就遇到和题主一样的问题,也是改View.propsTypes,然后报Listener is not supported for native driven events的错误。 我使用npm install react-native-scrollable-tab-view --save应该就是使用最新版的了吧,"^0.8.0"。希望老师能解答一下
2018-07-12
共6条回复

React Native技术精讲与高质量上线App开发

一个真实的上线项目,一次完整的开发过程,全面掌握React Native技术

1577 学习 · 727 问题

查看课程