Skip to content

Commit 49c939c

Browse files
committed
feat(CascadePicker): add example
1 parent 2bd28b8 commit 49c939c

File tree

6 files changed

+772
-83
lines changed

6 files changed

+772
-83
lines changed

app/pickerLogic/cascadePicker.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Platform,
1414
Modal,
1515
StatusBar,
16+
ActivityIndicator,
1617
Image
1718
} from 'react-native';
1819
import Pickroll from './cascadeRoll';
@@ -153,7 +154,7 @@ class CascadePicker extends Component {
153154
* @private
154155
*/
155156
_setEventBegin(){
156-
if (this.props.enable){
157+
if (this.props.enable && (this.props.data.length >= 1)){
157158
this.beforeData = this.props.data.slice();
158159
this.beforeOpe = this.choseNumber.slice();
159160
this.beforeValue = this.choseValue.slice();
@@ -274,8 +275,21 @@ class CascadePicker extends Component {
274275
/>
275276
<View style={[styles.pickContainer]} >
276277
{that.passData && that.passData.map((item,index) =>{
278+
if (this.props.loading[index]) {
279+
return (
280+
<View key={index} style={[{flex: 1, alignItems: 'center', backgroundColor: 'red', borderWidth:0}, Platform.OS !== 'ios' && {justifyContent: 'center'}]}>
281+
{Platform.OS === 'ios' && <View style={{position: 'absolute', width: 501, height: 35, borderTopWidth: 0.5, borderBottomWidth: 0.5, borderColor: '#ddd', marginTop: 90.5, borderLeftWidth: 0}} />}
282+
<ActivityIndicator
283+
animating={true}
284+
size="small"
285+
style={Platform.OS === 'ios' && {marginTop: 96}}
286+
/>
287+
</View>
288+
);
289+
}
277290
return (
278291
<PickRoll
292+
itemStyle={{fontSize: 16}}
279293
id = {this.props.id}
280294
name = {this.props.name}
281295
parentId = {this.props.parentId}

app/pickerLogic/pickerStyle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let rollStyles = StyleSheet.create({
5555
},
5656
middleText: {
5757
color: '#000',
58-
fontSize: 20,
58+
fontSize: 16,
5959
marginTop: 0,
6060
marginBottom: 0,
6161
}

0 commit comments

Comments
 (0)