gpt4 book ai didi

javascript - react native : what is the way to add frame around the picker to make it look nice?

转载 作者:行者123 更新时间:2023-12-04 08:54:27 24 4
gpt4 key购买 nike

如何在选择器周围添加框架?
在我的示例中,我尝试在选择器周围制作一个框架以使其看起来不错,但我没有成功,我不清楚为什么。
我正在运行 Android,但我看不到周围的框架

import { Picker } from '@react-native-community/picker';


<Picker
mode="dropdown"
//pickerStyleType={}
selectedValue={selectedValue}
style={{
color: 'black',
placeholderTextColor: 'black',
borderColor: 'black',
borderWidth: 3,
height: 50,
width: 150,
justifyContent: 'flex-end',
}}
onValueChange={(itemValue, itemIndex) => setSelectedValue(itemValue)}
>
<Picker.Item label="1" value="1" />
<Picker.Item label="2" value="2" />
<Picker.Item label="3" value="3" />
</Picker>

最佳答案

尝试用这样的 View 包装您的选择器

<View style={ { borderWidth: 1 } }></View> 

关于javascript - react native : what is the way to add frame around the picker to make it look nice?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63917547/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com