ListView 无法滚动 [英] ListView fails to scroll

查看:47
本文介绍了ListView 无法滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如您在附加的 GIF 中看到的那样,我无法滚动浏览 ListView.我一松开鼠标,视图就会立即回到原来的位置.

As you can see in the attached GIF, I can't scroll through the ListView. The view snaps back to the original position as soon as I release the mouse.

我已经阅读了文档,似乎滚动应该正常工作.下面是 render() 的实现:

I've read over the documentation and it seems like scrolling should just work. Here's the implementation of render():

render: function(){
  return (
    <ListView
      automaticallyAdjustContentInsets={false}
      initialListSize={9}
      dataSource={this.state.dataSource}
      renderRow={this.renderTrack}
      renderSectionHeader={this.renderSectionHeader}/>
  );

推荐答案

你的 ListView 实际上可能很小,但看起来不像可见溢出那样.尝试在 ListView 的样式属性上设置 flex: 1height: 587.

Your ListView might actually be quite small but not appear that way do to visible overflow. Try setting flex: 1 or height: 587 on your ListView's style property.

这篇关于ListView 无法滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆