Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuke-scroll-view

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-scroll-view

滚动组件

  • 1.0.3
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

ScrollView

  • category: Components
  • chinese: 滚动组件
  • type: 基本

ScrollView 是一个包装了滚动操作的组件。一般情况下需要一个确定的高度或 flex 1 来保证 ScrollView 的正常展现。

API

属性说明类型默认值
horizontal是否横向booleanfalse
showsHorizontalScrollIndicator是否显示水平滚动条booleantrue
showsVerticalScrollIndicator是否显示垂直滚动条booleantrue
onEndReachedThreshold设置加载更多的偏移string500rem
onEndReached滚动到底部时的事件( 距离底部 onEndReachedThreshold 长度时触发)event
scrollEventThrottle在滚动过程中,scroll事件被调用的频率(默认值为100),用于滚动的节流number100
onScroll滚动时触发的事件function

resetLoadmore 实例方法

//调用 resetLoadmore 以保证上一次加载不到数据后,下次还能继续触发 onEndReached
this.refs.scroller1.resetLoadmore();

//省略部分代码
<ScrollView ref="scroller1" onEndReached={this.loadmore}>
    {this.getViews()}
</ScrollView>

这是一个重置 onEndReached 是否能触发的 标记位的方法。 标记位默认为 true,即滚动到底部即可触发 onEndReached 事件。 但当 onEndReached 触发后,没有通过 setState 增加数据导致页面 scroller 内容变长,(或者反而变短了),native 端会将标记位设置为 false。 此时调用 resetLoadmore ,可以清除标记位,让 onEndReached 可以再次触发。

Keywords

FAQs

Package last updated on 28 Nov 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc