how can i change the theme or default background color for ios.. it's conflicting with my background image. I'd like to set it to transparent.. Thanks

- 761
- 9
- 18
-
which navigator are you using? – eden Feb 18 '17 at 09:26
-
@Enie Jakiro react-native-router-flux – Badmus Taofeeq Feb 18 '17 at 10:45
-
ok @badmus your answer is coming – eden Feb 18 '17 at 11:11
-
Alright, Thank you.. – Badmus Taofeeq Feb 18 '17 at 11:23
1 Answers
First let's understand how scenes in react-native-router-flux
works. When you define them in your navigator, like below,
<Scene sceneStyle={{marginTop: 64}} title="Home" key="home" component={Home} />
You simply say that, my content should render below the pre defined navbar. Which can be 54 or 64 depending on your OS. So when you use Router,
<Router navigationBarStyle={{backgroundColor: 'transparent'}}>
and add navigationBarStyle to every Scene you have by introducing that line, you almost forgot what you've done above, setting your Scene to align itself some margin below the navigationBar. Therefore you see nothing (white space) in your simulator.
In order to have what you need, do this where you want your image to appear full screen with navigation controls:
Actions.refresh({
key: 'home',
navigationBarStyle: {backgroundColor: 'transparent'},
sceneStyle: {marginTop: 0},
});
Or you can introduce this settings in your Scene component where you define it.
I tested this solution and it works on iOS, can't tell the same for Android, so please back up your code before making changes. You can further customize it to remove borderBottom line.

- 5,876
- 2
- 28
- 43
-
@BadmusTaofeeq Thank you :) You can accept this if it helped. This will let others know this answer satisfied your needs and they can apply it too. – eden Feb 18 '17 at 11:54