Skip to content

Commit

Permalink
feat(CascadePicker): add example
Browse files Browse the repository at this point in the history
  • Loading branch information
lulutia committed Mar 27, 2017
1 parent 2bd28b8 commit 49c939c
Show file tree
Hide file tree
Showing 6 changed files with 772 additions and 83 deletions.
16 changes: 15 additions & 1 deletion app/pickerLogic/cascadePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Platform,
Modal,
StatusBar,
ActivityIndicator,
Image
} from 'react-native';
import Pickroll from './cascadeRoll';
Expand Down Expand Up @@ -153,7 +154,7 @@ class CascadePicker extends Component {
* @private
*/
_setEventBegin(){
if (this.props.enable){
if (this.props.enable && (this.props.data.length >= 1)){
this.beforeData = this.props.data.slice();
this.beforeOpe = this.choseNumber.slice();
this.beforeValue = this.choseValue.slice();
Expand Down Expand Up @@ -274,8 +275,21 @@ class CascadePicker extends Component {
/>
<View style={[styles.pickContainer]} >
{that.passData && that.passData.map((item,index) =>{
if (this.props.loading[index]) {
return (
<View key={index} style={[{flex: 1, alignItems: 'center', backgroundColor: 'red', borderWidth:0}, Platform.OS !== 'ios' && {justifyContent: 'center'}]}>
{Platform.OS === 'ios' && <View style={{position: 'absolute', width: 501, height: 35, borderTopWidth: 0.5, borderBottomWidth: 0.5, borderColor: '#ddd', marginTop: 90.5, borderLeftWidth: 0}} />}
<ActivityIndicator
animating={true}
size="small"
style={Platform.OS === 'ios' && {marginTop: 96}}
/>
</View>
);
}
return (
<PickRoll
itemStyle={{fontSize: 16}}
id = {this.props.id}
name = {this.props.name}
parentId = {this.props.parentId}
Expand Down
2 changes: 1 addition & 1 deletion app/pickerLogic/pickerStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let rollStyles = StyleSheet.create({
},
middleText: {
color: '#000',
fontSize: 20,
fontSize: 16,
marginTop: 0,
marginBottom: 0,
}
Expand Down
Loading

0 comments on commit 49c939c

Please sign in to comment.