1.0.3 • Published 9 years ago
react-native-dj-indicator v1.0.3
Indicator

Install
npm i --save react-native-dj-indicatorUsage
Using in your app will usually look like this:
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
import Toast from 'react-native-dj-indicator';
export default class NPMTest extends Component {
render() {
return (
<View style={{marginTop:20}}>
<Indicator ref="indicator" icon={require('./NPM/react-native-dj-indicator/images/loading_page.png')} width={60} height={60} hide={false}/>
</View>
);
}
}
AppRegistry.registerComponent('xxx', () => NPMTest);Props
The following props can be used to modify the style and/or behaviour:
| Prop | Type | Opt/Required | Default | Note |
|---|---|---|---|---|
icon | object | Option | require('image!loading_page') | loading图标,形式如 require('image!loading_page')/{uri:'loading_page.png'} |
width | int | Option | 40 | loading图标的宽度 |
height | int | Option | 40 | loading图标的高度 |
top | int | Option | 0 | 遮罩距顶部的距离 |
hide | boolean | Option | false | 是否默认隐藏Indicator |
Methods
The following methods can be used to open and close the Dialog:
| Method | Parameters | Note |
|---|---|---|
show | |打开Indicator | |
cancel | |关闭Indicator |