Skip to content

Commit

Permalink
fix: setTranslucent and setBackgroundColor are Android only (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
machour authored and chinesedfan committed Dec 5, 2017
1 parent 7aaa5f6 commit 55abff8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AsyncStorage,
LayoutAnimation,
StatusBar,
Platform,
} from 'react-native';
import { persistStore } from 'redux-persist';
import createEncryptor from 'redux-persist-transform-encrypt';
Expand Down Expand Up @@ -103,8 +104,10 @@ class App extends Component {
routeName
);

StatusBar.setTranslucent(translucent);
StatusBar.setBackgroundColor(backgroundColor);
if (Platform.OS === 'android') {
StatusBar.setTranslucent(translucent);
StatusBar.setBackgroundColor(backgroundColor);
}
StatusBar.setBarStyle(barStyle);
}

Expand Down

0 comments on commit 55abff8

Please sign in to comment.