New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何使用react-native-picker做一个地区选择组件? #9
Comments
onPickerDone接收一个参数,这个参数就是选中的值,它是个数组 例子:https://github.com/beefe/react-native-date-picker/blob/master/index.js#L48-L50 |
你用这个做过省市级选择器吗 |
做过,没有发上来,你把各个省市组成我readme里面写的那种级联的结构,放到pickerData里面就好了,类似于react-native-date-picker |
谢谢 我已经做出来了 http://pic.ofcard.com/themes/common/region/China_Region_Last.js 这就是全国省市县级的数据 |
👍 上面的代码太多了,我放到代码仓库里了,我是例子 |
安卓的可以用? |
可用,有个小bug暂时没修复:滚轮上的文字超过最大长度会影响滚动和显示效果,你可以尝试修复它然后提个PR :) |
<Picker
ref={(cpicker) => {this.cpicker = cpicker}}
pickerHeight={300}
showDuration={300}
pickerData = {pickerData}
selectedValue = {3}
onPickerDone={()=>(ToastAndroid.show(????, ToastAndroid.SHORT))}//when confirm your choice
/>
The text was updated successfully, but these errors were encountered: