如何将fontSize提供给picker(android)?我试着给它,但它不起作用
<Picker
style={{fontSize:20}}
selectedValue={this.state.language}
onValueChange={(lang) => this.setState({language: lang})}>
<Picker.Item label="Java" value="java" />
<Picker.Item label="JavaScript" value="js" />
</Picker>
Run Code Online (Sandbox Code Playgroud) 我搜索很多,但我确实发现如何给反应原生的z-index属性,如果我在反应原生中使用zIndex它显示我错误,这是无效的样式道具类型.
这是我的渲染代码.正如你在下面看到的那样,我想让autoContainer视图可见.所以请告诉我如何在不使用任何第三方库的情况下使其成为现实.
render() {
return (
<View style={{flex:1}}>
<View style={[styles.inputWrap,this.props.error]}>
<TextInput
style={[style.input,this.props.style]}
ref={this.props.name}
onChangeText={(text) =>this.searchItem(this.props.options,text)}
value={this.state.value}
placeholder={this.props.placeholder}
placeholderTextColor="#000000"
keyboardType={this.props.keyboard}
/>
</View>
{this.toggleAuto()}
</View>
)
}
toggleAuto()
{
if(this.state.autoList!='')
{
return (<View style={style.autoContainer}>
{this.renderList(this.state.autoList)}
</View>
);
}
}
const style = StyleSheet.create({
input:{
flex:1,
height:50,
fontSize:16,
backgroundColor:'#ffffff',
paddingLeft:10,
},
autoContainer: {
borderTopColor:"#888888",
borderTopWidth:1,
position:"absolute",
right:0,
left:0
},
list: {
backgroundColor:'#f2f2f2',
padding:10,
borderColor:'#888888',
borderBottomWidth:1,
borderLeftWidth:1,
borderRightWidth:1
}
});
Run Code Online (Sandbox Code Playgroud) react-native ×2