我如何在 react-native 中更改下拉列表中 arrowIcon 的大小和位置?
How i change size and positions of arrowIcon in Dropdown in react-native?
我如何在 react-native 中更改下拉列表中 arrowIcon 的大小和位置?
我正在为我的应用程序使用这个。
import { Dropdown } from 'react-native-material-dropdown';
<Dropdown
value={this.state.label}
data={this.state.data}
pickerStyle={{}}
textColor='black'
dropdownOffset={{ 'top': 0 }}
label="More option"
containerStyle={styles.dropdowngender}
fontSize={20}
onChangeText={(value) => {
this.setState({
value
});
}}
/>
转到节点模块文件夹并找到 react native material 下拉文件夹。有一个index.js文件,打开它,找到这个块;
renderAccessory() {
return (
<View style={styles.accessory}>
<Image source={require('../../../../../Src/Images/drop-down.png')} style={{ width: 30, height: 12, resizeMode: 'contain', tintColor: '#777777' }} />
</View>
);
}
您可以在这里更改样式,甚至可以通过放置您自己的 png 来更改图标。
我如何在 react-native 中更改下拉列表中 arrowIcon 的大小和位置?
我正在为我的应用程序使用这个。
import { Dropdown } from 'react-native-material-dropdown';
<Dropdown
value={this.state.label}
data={this.state.data}
pickerStyle={{}}
textColor='black'
dropdownOffset={{ 'top': 0 }}
label="More option"
containerStyle={styles.dropdowngender}
fontSize={20}
onChangeText={(value) => {
this.setState({
value
});
}}
/>
转到节点模块文件夹并找到 react native material 下拉文件夹。有一个index.js文件,打开它,找到这个块;
renderAccessory() {
return (
<View style={styles.accessory}>
<Image source={require('../../../../../Src/Images/drop-down.png')} style={{ width: 30, height: 12, resizeMode: 'contain', tintColor: '#777777' }} />
</View>
);
}
您可以在这里更改样式,甚至可以通过放置您自己的 png 来更改图标。