版本:@react-native-picker/picker 1.14.0 代码:
<Picker
selectedValue={hours}
onValueChange={handleHourChanged}
style={{ flex: 1, justifyContent: "center" }}
itemStyle={{
textAlign: "center",
}}
>
{hour.map(v => {
return <Picker.Item label={v.toString()} value={v} />;
})}
</Picker>
实际截图:
预期的: