react-native - 构建 UI react-native 需要哪个组件
解决方案
使用选择器height
核心中的https://reactnative.dev/docs/picker#__docusaurus已弃用。
独立模块
https://github.com/react-native-community/react-native-picker
将此用于gender
.
来自核心的https://reactnative.dev/docs/segmentedcontrolios#__docusaurus已弃用。
独立模块
https://github.com/react-native-community/segmented-control
编辑:对于性别这样做
<Picker
selectedValue={this.state.language}
style={{height: 50, width: 100}}
onValueChange={(itemValue, itemIndex) =>
this.setState({language: itemValue})}>
{ YourData.map(item=>
<Picker.Item label={item.label} value={item.value} />
)
}
</Picker>
推荐阅读
- machine-learning - 几乎不变的特征怎么办?
- numpy - 如何从张量中选择子张量
- javascript - 使用图像对 javasript 中的数据进行排序
- python - 通过 Python 与 USB 仪器(AlphaLab Gaussmeter)进行串行通信时出现问题
- python - 计算拆分字符串中的辅音和元音
- typescript - 打字稿如何比较声明的类型
- javascript - 如何使用键获取 javascript 对象的值
- xcode - macOS 单元测试中的 NSAllowsArbitraryLoads
- kubernetes - 如何跳过 Argo 工作流程的步骤
- java - 用实际值替换字符串中的变量 - Groovy