Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A pull down to refresh control for react native.

NotificationsYou must be signed in to change notification settings

Shuangzuan/RCTRefreshControl

Repository files navigation

A pull down to refresh control for react native.

Screen Shot

Screen Shot

Installation

  1. Runnpm install react-refresh-control --save in your project directory.
  2. DragRCTRefreshControl.xcodeproj to your project on Xcode.
  3. Click on your main project file (the one that represents the .xcodeproj) select Build Phases and draglibRCTRefreshControl.a from the Products folder inside theRCTRefreshControl.xcodeproj.
  4. Addvar RCTRefreshControl = require('react-refresh-control'); to your code.

Usage

'use strict';varReact=require('react-native');varTimerMixin=require('react-timer-mixin');varRCTRefreshControl=require('react-refresh-control');var{  AppRegistry,  ListView,  ScrollView,  StyleSheet,  Text,  View}=React;varSCROLLVIEW='ScrollView';varLISTVIEW='ListView';varRCTRefreshControlDemo=React.createClass({mixins:[TimerMixin],getInitialState:function(){vards=newListView.DataSource({rowHasChanged:(r1,r2)=>r1!==r2});return{dataSource:ds.cloneWithRows(['#484848','#2F9C0A','#05A5D1']),};},componentDidMount:function(){// ScrollViewRCTRefreshControl.configure({node:this.refs[SCROLLVIEW],tintColor:'#05A5D1',activityIndicatorViewColor:'#05A5D1'},()=>{this.setTimeout(()=>{RCTRefreshControl.endRefreshing(this.refs[SCROLLVIEW]);},2000);});// ListViewRCTRefreshControl.configure({node:this.refs[LISTVIEW]},()=>{this.setTimeout(()=>{RCTRefreshControl.endRefreshing(this.refs[LISTVIEW]);},2000);});},render:function(){return(<Viewstyle={styles.container}><ScrollViewref={SCROLLVIEW}style={styles.scrollView}><Viewstyle={{backgroundColor:'#05A5D1',height:200}}/><Viewstyle={{backgroundColor:'#FDF3E7',height:200}}/><Viewstyle={{backgroundColor:'#484848',height:200}}/></ScrollView><ListViewref={LISTVIEW}style={styles.listView}dataSource={this.state.dataSource}renderRow={(rowData)=>{varcolor=rowData;return(<Viewstyle={{backgroundColor:color,height:200}}/>);}}/></View>);}});varstyles=StyleSheet.create({container:{flex:1,flexDirection:'row'}});AppRegistry.registerComponent('RCTRefreshControlDemo',()=>RCTRefreshControlDemo);

License

Available under the MIT license. See the LICENSE file for more informatiion.

About

A pull down to refresh control for react native.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp