构建 UI react-native 需要哪个组件
Which component required to build UI react-native
我想构建 UI
,如下图所示,任何人都可以建议我在 react-native
中制作这个 UI 需要使用哪个组件
this for height
this for gender
为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>
我想构建 UI
,如下图所示,任何人都可以建议我在 react-native
this for height
this for gender
为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>