如何在 android 中设置 react native expo 选择器的样式
Posted
技术标签:
【中文标题】如何在 android 中设置 react native expo 选择器的样式【英文标题】:how to style react native expo picker in android 【发布时间】:2020-12-27 19:02:19 【问题描述】:如何在 android 中设置 react native expo picker 的样式,例如更改字体大小和居中文本以及更改文本输入的背景
<Picker
selectedValue=branch
mode="dropdown"
style=
// fontSize: 24,
// borderRadius: 14,
backgroundColor: '#BEDCEF',
height: 40,
// alignItems: 'center',
// justifyContent:'center',
// alignContent:'center',
// shadowColor:'black',
// shadowOffset:width:0,height:2,
// shadowRadius:6,
// shadowOpacity:0.26,
width:350,
elevation:10,
// marginBottom:290
itemStyle =
fontSize: 24,
alignItems: 'center',
justifyContent:'center',
color:'red',
backgroundColor:'purple'
onValueChange=(itemValue, itemIndex) => setBranch(itemValue)
>
【问题讨论】:
不支持github.com/react-native-community/react-native-picker/issues/47 【参考方案1】:您拥有 atm 的唯一选择是使用道具更改下拉图标的颜色(最新版本支持)
dropdownIconColor=
【讨论】:
以上是关于如何在 android 中设置 react native expo 选择器的样式的主要内容,如果未能解决你的问题,请参考以下文章
如何在 React Native for android 中设置阴影?
如何在 React Native 中设置 Android 屏幕、分辨率、纵横比和大小?
如何在 React Native 中设置 iOS 状态栏背景颜色?
如何在 iOS 的 WebView(react-native-webview) 中设置自定义字体?