image color become blue when using leftButtonIcon in NavigatorIOS

时间:2017-10-12 09:37:44

标签: ios react-native

I want add a left image in navigationbar,but it's color become blue my code like this:

return <NavigatorIOS 
            initialRoute = {{
                component:HomeScreen,
                title:'test',
                leftButtonIcon:require('../img/home_setting_icon.png'),
                translucent:false
            }}
        />

My image like this: enter image description here but the effect likes below: enter image description here

1 个答案:

答案 0 :(得分:0)

In iOS it depends on the bar tint color, set that to the desired one (e.g. purple)

navigationController?.navigationBar.tintColor = .green

For original image color:

someBarButtonItem.image = UIImage(named:"myImage")?.withRenderingMode(.alwaysOriginal)