facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.26k stars 24.35k forks source link

Settings UITabBar Tint #626

Closed skevy closed 9 years ago

skevy commented 9 years ago

What's the best way to set UITabBar tint in React Native?

In just plain ole Objective-C you'd do:

[[UITabBar appearance] setTintColor:[UIColor whiteColor]];

I don't see a specific way to set appearance properties in React Native when looking through the code. Would this need a separate API of some kind, or is there some simple way to do it that I'm missing?

skevy commented 9 years ago

cc @nickhudkins

Kureev commented 9 years ago

:+1: I tried to implement custom component with backgroundColor and I always got it overriden by white color. How and why? I'm not passing any style attribute to the component.

nickhudkins commented 9 years ago

UITabBar tintColor is controlled by the static setTintColor method on UITabBar#appearance. In order to actually adjust the TabBarItem tint, you either need to implement custom Tab Bar Items, or you'll need to provide a hook to the method @skevy mentioned.

brentvatne commented 9 years ago

This is resolved now here