我想在react native中实现一个下拉组件,其中可以使用react native中的单选按钮组件在下拉列表中选择一项。
答案 0 :(得分:0)
https://www.npmjs.com/package/react-native-simple-radio-button
mport RadioForm, {RadioButton, RadioButtonInput, RadioButtonLabel} from 'react-native-simple-radio-button';
var radio_props = [
{label: 'param1', value: 0 },
{label: 'param2', value: 1 }
];
<RadioForm
radio_props={radio_props}
initial={0}
onPress={(value) => {this.setState({value:value})}}
/>