1.0.0 • Published 8 years ago

react-native-loading-w v1.0.0

Weekly downloads
5
License
ISC
Repository
github
Last release
8 years ago

Loading

npm install react-native-loading-w --save

Usage

import Loading from 'react-native-loading-w';

//view
render() {
	return (
		<View>
			<Text>test loading</Text>
			<Loading ref={'loading'} text={'Loading...'} />
		</View>
	);
}

getLoading() {
	return this.refs['loading'];
}

//usage
this.getLoading().show();
//or
this.getLoading().show('uploading...');
//or
this.getLoading().show('uploading...', true);
this.getLoading().dismiss();

Run Screenshot iOS && Android

npm.io npm.io

Props:

text - (string) - loading text
textStyle - (object) - loading text style
pointerEvents - (bool) - loading can click on the bottom of the content, default is false
bottomStyle - (object) - loading the bottom cover background style
loadingStyle - (object) - loading background style
timeout - (number) - loading timeout, default none
onLoadingTimeout - (function) - loading timeout callback

Method:

show(text:string, pointerEvents:bool) - show loading
dismiss() - dismiss loading
isShown() - return loading is showed
setLoadingOffset(x:number, y:number) - set loading offset
setLoadingTimeout(timeout:number, onLoadingTimeout:function) - set loading timeout and timeout callback
clearLoadingTimeout() - clear loading timeout

Run Example

git clone https://github.com/wenxucheng/react-native-loading-w.git
cd Example && npm install
react-native run-ios
react-native run-android