import React, { Component } from 'react';
import { Picker } from 'react-native';
export default class pik extends Component {
render() {
return (
<Picker
selectedValue={'Hotels'}
mode={'dropdown'}
style={{
height: 50,
width: 150,
fontSize: 50,
}}>
<Picker.Item style={{ fontSize: 100 }} label="Hotels" value="Hotels" />
<Picker.Item label="Food" value="Foosd" />
</Picker>
);
}
}
错误
答案 0 :(得分:-1)
如果要设置样式以应用于每个项目标签,请使用itemStyle。
import React, { Component } from 'react';
import { Picker } from 'react-native';
export default class pik extends Component {
render() {
return (
<Picker
selectedValue={'Hotels'}
mode={'dropdown'}
itemStyle={{
height: 50,
width: 150,
fontSize: 50,
}}>
<Picker.Item style={{ fontSize: 100 }} label="Hotels" value="Hotels" />
<Picker.Item label="Food" value="Foosd" />
</Picker>
);
}
}