Skip to content

Commit 27086af

Browse files
committed
🔳 Make StatusBar translucent on Android.
1 parent 7110b85 commit 27086af

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

example/FastImageExample.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
Text,
66
StyleSheet,
77
ScrollView,
8+
StatusBar,
89
} from 'react-native'
910
import Icon from 'react-native-vector-icons/Ionicons'
1011
import FastImage from 'react-native-fast-image'
@@ -35,6 +36,7 @@ class FastImageExample extends Component {
3536
style={styles.container}
3637
key={key}
3738
>
39+
<StatusBar translucent barStyle="dark-content" backgroundColor="transparent" />
3840
<ScrollView
3941
style={styles.scrollContainer}
4042
contentContainerStyle={styles.scrollContentContainer}

example/ImageGrid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
View,
66
FlatList,
77
Platform,
8+
StatusBar,
89
} from 'react-native'
910

1011
const getImageUrl = (id, width, height) => `https://unsplash.it/${width}/${height}?image=${id}`
@@ -78,7 +79,7 @@ class ImageGrid extends Component {
7879
}
7980

8081
const MARGIN = 2
81-
const STATUS_BAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0
82+
const STATUS_BAR_HEIGHT = Platform.OS === 'ios' ? 20 : StatusBar.currentHeight
8283

8384
const styles = StyleSheet.create({
8485
statusBarUnderlay: {

0 commit comments

Comments
 (0)