ReactNative 分享解决listView的一个郁闷BUG


用ListView的时候,会出现一个非常傻bi的情况,就是render的时候,listView不显示,需要碰/滑一下才会显示。

一开始我在怀疑自己是不是布局哪里有冲突,改到哭都没发现布局有什么问题,直到我谷歌了一下 “react native listView not show touch”...

最后,我按react native里的issue:

在初始化listView时设置属性

removeClippedSubviews={false}

<ListView
    ref = {"listView"}
    style={styles.listView}
    dataSource={this.dataSource.cloneWithRows(this.state.data)}
    renderRow={this._renderRow.bind(this) }
    enableEmptySections={true}
    removeClippedSubviews={false}>
</ListView>

 

原issue:

https://github.com/facebook/react-native/issues/1831


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM