================================================
For IOS and Android:
npm install react-native-global-ui --save
import {
Loading
} from 'react-native-global-ui'
Loading.show()
Loading.hide()
================================================
Mask view is a wrap view behide our global View.
It have three type: 'none', 'block', 'full'.
type | effect |
---|---|
none | there has nothing behind global view, you can click other button and view |
block | there has an Opacity mask behind global view, but the navigation bar can be clicked |
full | Full screen are covered by mask, you can do nothing before call hide |
Prop | Type | Description |
---|---|---|
maskType |
PropTypes.oneOf(['none','block','full']) |
Default full. |
blockHeight |
?number |
Effect when type is block. Default (Platform.OS === 'ios' ? 44 : 56). |
maskStyle |
ViewPropTypes.style |
react native element style. Default { backgroundColor: 'black'}. |
bgClose |
?bool |
Click mask to close UI when true. Default false. |
opacity |
?number |
Opacity of mask Default 0.3. |
Loading is used to indicate some asynchronous operations。
Prop | Type | Description |
---|---|---|
loadingText |
?PropTypes.string |
Loading text. Default 加载中. |
loadingTextStyle |
?Text.propTypes.style |
Loading text style |
indicatorStyle |
?ViewPropTypes.style |
Indicator Style. Default { : 'black'}. |
indicatorSize |
?PropTypes.oneOfType([PropTypes.oneOf([ 'small', 'large' ]),PropTypes.number ]) |
Indicator Size. Default 'large'. |
indicatorColor |
?ColorPropType |
Indicator color Default 'white'. |
customLoadingElem |
?PropTypes.element |
If you need to customize your own components, you can use this props |
we offer two method to use Loading:
- Loading
import {
Loading
} from 'react-native-global-ui'
Loading.show({
props
})
In this way, The function accepts an Object as an argument, and Object stores the required props for loading.
Loading.show({maskType: 'block',loadingText: 'nav可点哦'})
Loading.show({loadingText: 'loading Text'})
- LoadingBuilder
import {
LoadingBuilder
} from 'react-native-global-ui'
LoadingBuilder().injectParams({prpos}).show()
In this way, User can Call by chain and use some more understandable functions.
LoadingBuilder().setMaskType('none').setLoadingTextStyle({'color': 'red', fontSize: 20}).show()
LoadingBuilder().setLoadingText('loading Text').show()
func | params | Description |
---|---|---|
injectParams |
Object |
Accept all props . |
injectMaskParams |
Object |
Accpet mask props see above. |
injectIndicateParams |
Object |
Accpet indicate props see above. |
setMaskType |
PropTypes.oneOf(['none','block','full']) |
set mask type |
setLoadingText |
String |
|
setLoadingTextStyle |
?Text.propTypes.style |
|
setCustomLoading |
?PropTypes.element |
You can find some examples in example project