zoukankan      html  css  js  c++  java
  • ReactNative 分享解决listView的一个郁闷BUG

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

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

    最后,我按react native里的issue:

    在初始化listView时设置属性

    removeClippedSubviews={false}

    1
    2
    3
    4
    5
    6
    7
    8
    <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

     
     

     
     
  • 相关阅读:
    喷水装置(一)
    下沙小面的(2)
    +-字符串
    非洲小孩
    寻找最大数(三)
    C
    寻找最大数
    阶乘之和
    背包问题
    python的内存管理机制(zz)
  • 原文地址:https://www.cnblogs.com/northWolves/p/6590061.html
Copyright © 2011-2022 走看看