我如何更改react-native中Dropdown中arrowIcon的大小和位置?

问题描述 投票:1回答:1

如何更改本机下拉菜单中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 react-native-android react-native-ios
1个回答
2
投票

转到节点模块文件夹,然后找到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来更改图标。

© www.soinside.com 2019 - 2024. All rights reserved.