react-native-material-dropdown icon indicating copy to clipboard operation
react-native-material-dropdown copied to clipboard

Changing the dropdwon arrow icon

Open KiranUppunda opened this issue 6 years ago • 12 comments

Hi,

I want to change the default dropdown-arrow icon. Can you please let me know how to proceed with ?

Thank you.

KiranUppunda avatar Jun 03 '19 11:06 KiranUppunda

i have same issue

iamir4g avatar Sep 01 '19 11:09 iamir4g

Use the renderAccessory property. Write a function that returns the icon you want.

irwinwilliams avatar Oct 06 '19 17:10 irwinwilliams

@kiranUppunda @iamir4g @irwinwilliams

I solve this problem.

Go to node module file -> react-native-material-dropdown

image

Use your image path in Image tag source.

renderAccessory() {
    return (
      <View style={styles.accessory}>
        <Image source={require('../../../../../Src/Images/drop-down.png')} style={{ width: 30, height: 12, resizeMode: 'contain', tintColor: '#777777' }} />
      </View>
    );
  }

shahrajk avatar Dec 15 '19 16:12 shahrajk

@shahrajk this is will not working if you are using a git repo!

Thamaluka avatar Dec 17 '19 20:12 Thamaluka

@irwinwilliams thanks. works like a charm

Subway19 avatar Jan 06 '20 09:01 Subway19

But it shows bottom border and popup not positioning

<Dropdown
        value={selectedAddress}
        onChangeText={(value, index, data) => {
          setSelectedAddress(value);
        }}
        data={address}
        // containerStyle={{width:100, }}
        dropdownPosition={0}
        dropdownOffset={{top:10, left:0, }}
        pickerStyle={{ }}
        renderAccessory={()=> <View style={{width:50, borderWidth:1}}>
        <Image source={{uri:'http://placekitten.com/50/50'}} style={{ width: 30, height: 30, resizeMode: 'contain', tintColor: '#777777' }} />
      </View>}
      /> 

PrashenAlumnus avatar Apr 08 '20 11:04 PrashenAlumnus

@KiranUppunda @iamir4g @irwinwilliams

I solve this problem.

Go to node module file -> react-native-material-dropdown

image

Use your image path in Image tag source.

renderAccessory() {
    return (
      <View style={styles.accessory}>
        <Image source={require('../../../../../Src/Images/drop-down.png')} style={{ width: 30, height: 12, resizeMode: 'contain', tintColor: '#777777' }} />
      </View>
    );
  }

Thanks. It worked for me. Although I used React native dropdown picker v4 but ur hint helped me in updating the icon <3

mueenrehman avatar Feb 26 '21 09:02 mueenrehman

Hi guys, I am using react-native-material-dropdown-v2-fixed. I want to change background of dropdown arrow. How can I change the color of it? Currently it is dark gray.

dropdown

Munish-GitHub avatar Mar 15 '21 00:03 Munish-GitHub

For fix this problem: baseColor={'transparent'}

Example: import React, { Component } from 'react'; import { Dropdown } from 'react-native-material-dropdown';

class Example extends Component { render() { let data = [{ value: 'Banana', }, { value: 'Mango', }, { value: 'Pear', }];

return (
  <Dropdown
    label='Favorite Fruit'
    data={data}
    baseColor={'transparent'}
  />
);

} }

LeandroBernardo avatar Apr 27 '21 19:04 LeandroBernardo

For fix this problem: baseColor={'transparent'}

Example: import React, { Component } from 'react'; import { Dropdown } from 'react-native-material-dropdown';

class Example extends Component { render() { let data = [{ value: 'Banana', }, { value: 'Mango', }, { value: 'Pear', }];

return (
  <Dropdown
    label='Favorite Fruit'
    data={data}
    baseColor={'transparent'}
  />
);

} }

I will give a try and get back to you. Thanks for your reply :)

Munish-GitHub avatar Apr 27 '21 23:04 Munish-GitHub

@PrashenAlumnus add the following to the component: underlineColor="transparent"

greulist137 avatar Feb 26 '22 19:02 greulist137

@greulist137 it was a long back issue, it is about to complete 2 years now :) BTW thanks for the comment.

prashen avatar Mar 14 '22 18:03 prashen