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

Change arrow down and arrow up color.

Open NikitaNS opened this issue 2 years ago • 9 comments

I want to change the color for the arrow down or up icon. How can I change the icon color, what is the difference between arrowIconStyle and arrowIconContainerStyle?

NikitaNS avatar Jan 17 '23 14:01 NikitaNS

Hey the best approach here is to create your own arrows and render them with ArrowUpIconComponent and ArrowDownIconComponent

https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/advanced/icons

It will be nice to change the color but at the moment its not possible, or go directly into the code and patch it hard-coded

alelaru avatar Feb 23 '23 14:02 alelaru

i believe arrowIconStyle is the arrow and arrowIconContainerStyle is the thing that contains it, but it is not visible since it has no borders or background color on default

loloide avatar Jun 08 '23 23:06 loloide

Late but here's the solution:

arrowIconStyle={{tintColor: 'red'}}

murat-mehmet avatar Aug 11 '23 11:08 murat-mehmet

Late but here's the solution:

arrowIconStyle={{tintColor: 'red'}}

Nice! Would you mind to explain why tintColor works?

chunghn avatar Sep 13 '23 08:09 chunghn

Late but here's the solution:

arrowIconStyle={{tintColor: 'red'}}

Nice! Would you mind to explain why tintColor works?

arrowIconStyle is used as Image style in Picker.js

tintColor field is used in Image component to colorize the whole image.

murat-mehmet avatar Sep 13 '23 11:09 murat-mehmet

Late but here's the solution:

arrowIconStyle={{tintColor: 'red'}}

@murat-mehmet how to solve the typing issue here?

Type '{ tintColor: string; }' is not assignable to type 'StyleProp<ViewStyle>'. 
Object literal may only specify known properties, and 'tintColor' does not exist in type 'ViewStyle | RecursiveArray<Falsy | ViewStyle | RegisteredStyle<ViewStyle>>'.
index.d.ts(169, 5): The expected type comes from property 'arrowIconStyle' which is declared here on type 'IntrinsicAttributes & PropsWithoutRef<DropDownPickerProps<string>>'

YuliiaNovak avatar Jan 10 '24 21:01 YuliiaNovak

I would just cast to any or ignore it for now.

The type definition is incorrect in index.d.ts. I just opened PR #735 to fix it.

murat-mehmet avatar Jan 11 '24 09:01 murat-mehmet

For me this did the trick.

iconStyle={{ tintColor: '#57D497' }}

Diogo107 avatar May 09 '24 13:05 Diogo107

Late but here's the solution:

arrowIconStyle={{tintColor: 'red'}}

Nice! Would you mind to explain why tintColor works?

arrowIconStyle is used as Image style in Picker.js

tintColor field is used in Image component to colorize the whole image.

this works for me. someone should close this issue

hassamarifdev avatar Jul 15 '24 13:07 hassamarifdev