New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

nuke-list-view

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-list-view

列表

2.3.2
Version published
Weekly downloads
68
385.71%
Maintainers
3
Weekly downloads
 
Created

Listview

  • category: UI
  • chinese: 列表
  • type: UI 组件

何时使用

用于展现一个数据列表,和 ScrollView 不同,ListView 使用 weex list 组件内存回收复用的能力,达到复用 cell 不卡顿的效果。

API

ListView

属性说明类型默认值
renderHeader头部function
renderFooter底部function
renderRow渲染单行的方法function
dataSource数据源array
onEndReached加载到底部时触发 的事件原 onloadmore 事件
onEndReachedThreshold加载更多的位移量string500
showScrollbar是否显示滚动条bool
resetLoadmore实例方法,用于再次触发 loadmore [以下单独说明]function

resetLoadmore 实例方法

这是一个重置 onEndReached 是否能触发的 标记位的方法。

当 onEndReached 触发后,如果页面内容没有变长,或者反而变短了,下次再滑动到底部,onEndReached 不会被触发了。此时调用 resetLoadmore ,可以清除内置标记位,让 onEndReached 可以再次触发。

  // 调用 resetLoadmore 以保证上一次加载不到数据后,下次还能继续触发 onEndReached
  reset=(e)=>{
    this.refs.mylist.resetLoadmore();
  }
  render(){
    return (
      <ListView ref="mylist"
        renderHeader={this.renderHeader}
        renderFooter={this.renderFooter}
        renderRow={this.renderItem}
        dataSource={this.state.data}
      />
    )
  }

Keywords

FAQs

Package last updated on 15 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts