android toggle bug

This commit is contained in:
xwenliang
2016-09-22 11:25:21 +08:00
parent 1ba6216ed4
commit e23e33df2b
5 changed files with 19 additions and 5 deletions

View File

@@ -6,9 +6,6 @@ A Native Picker with high performance.
pure javascript version -> [v3.0.5](https://github.com/beefe/react-native-picker/tree/pure-javascript-version)
![ui](./doc/ui.gif)
![ui2](./doc/ui2.jpg)
###Documentation

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

@@ -110,6 +110,16 @@ export default class PickerTest extends Component {
});
}
_toggle() {
Picker.toggle();
}
_isPickerShow(){
Picker.isPickerShow(status => {
alert(status);
});
}
render() {
return (
<View style={{height: Dimensions.get('window').height}}>
@@ -119,6 +129,12 @@ export default class PickerTest extends Component {
<TouchableOpacity style={{marginTop: 10, marginLeft: 20}} onPress={this._showAreaPicker.bind(this)}>
<Text>AreaPicker</Text>
</TouchableOpacity>
<TouchableOpacity style={{marginTop: 10, marginLeft: 20}} onPress={this._toggle.bind(this)}>
<Text>toggle</Text>
</TouchableOpacity>
<TouchableOpacity style={{marginTop: 10, marginLeft: 20}} onPress={this._isPickerShow.bind(this)}>
<Text>isPickerShow</Text>
</TouchableOpacity>
</View>
);
}

View File

@@ -67,8 +67,9 @@ export default {
},
isPickerShow(fn){
Picker.isPickerShow(hide => {
fn(!hide);
//android return show or not, ios return hide or not...
Picker.isPickerShow(status => {
fn(android ? status : !status);
});
}
};