Comments (7)
demo只是几个picker的使用例子,不能直接运行,需要在具体项目中才能使用
from react-native-picker.
var PageContainer = React.createClass ({
getInitialState :function(){
return({
pickerData: [{
'北京': {
'北京': ['朝阳区']
}
}],
selectedValue: ['北京', '北京', '朝阳区']
});
},
_onPressHandle :function(){
this.picker.toggle();
},
render :function(){
return (
<View style={{height: Dimensions.get('window').height}}>
<TouchableOpacity style={{marginTop: 20}} onPress={this._onPressHandle}>
<Text>点我</Text>
</TouchableOpacity>
<Picker
ref={picker => this.picker = picker}
pickerHeight={320}
showDuration={300}
pickerData={this.state.pickerData}
selectedValue={this.state.selectedValue}
onPickerDone={(pickedValue) => {
console.log(pickedValue);
}}/>
</View>
);
}
from react-native-picker.
我是这样写的
from react-native-picker.
道理说应该没有问题啊
from react-native-picker.
@xuefengyang
Cascade 模式下, pickerData 是个json而不是数组...
getInitialState :function(){
return({
pickerData: {
'北京': {
'北京': ['朝阳区']
}
},
selectedValue: ['北京', '北京', '朝阳区']
});
}
from react-native-picker.
必须是数组类型的才可以吗? @xwenliang
from react-native-picker.
必须是key:value的object... 这块数据格式写的比较死
from react-native-picker.
Related Issues (20)
- 标题过长时, 安卓上标题和左右按钮有部份重叠
- Task :react-native-picker:compileReleaseJavaWithJavac FAILED HOT 2
- Task :react-native-picker:compileReleaseJavaWithJavac FAILED
- Typescript typings are wrong for `onPicker*` functions
- Attempted import error: 'PickerIOS' is not exported from 'react-native-web/dist/index'.
- Changing font size hides title toolbar HOT 2
- android/iOS
- Radio Buttons on Android Devices
- java.lang.IllegalStateException: Should be called from the main thread, not Thread[mqt_native_modules HOT 2
- fontSize改大会遮挡住toolbar
- TypeError: undefined is not an object (evaluating '_reactNativePicker.Picker.init
- picker button text cannot display all
- could not find method compile() for arguments
- Compiling failed because targetSdkVersion is too low HOT 1
- android运行报错
- could not find method compile() for arguments HOT 4
- ios,picker点击取消按钮后再次打开picker会导致无法显示数据,附解决办法。
- [iOS] 关闭动画无效果的原因
- Alternative with Expo?
- Cancel and Confirm Button hiding behind the dynamic island and notch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-picker.