-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYYSpinner.js
More file actions
35 lines (31 loc) · 710 Bytes
/
YYSpinner.js
File metadata and controls
35 lines (31 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Created by yiyang on 16/1/7.
*/
'use strict';
import React from 'react-native';
let {
View,
ActivityIndicatorIOS,
ProgressBarAndroid,
Platform
} = React;
export default class YYSpinner extends React.Component {
_getSpinner() {
if (Platform.OS == 'ios') {
return(
<ActivityIndicatorIOS animating={true} size="small" {...this.props}/>
);
} else {
return(
<ProgressBarAndroid style={{height: 20}} styleAttr="Inverse" {...this.props}/>
);
}
}
render() {
return (
<View>
{this._getSpinner()}
</View>
);
}
}