React-native-swiper: Text going behind the android navbar

Created on 19 Jun 2017  ·  4Comments  ·  Source: leecade/react-native-swiper

Hi,

I'm getting this problem The text is getting behind the navbar, it seems the swiper excludes the navbar and puts the text behind it...any sugestion ? Thanks!

Most helpful comment

you have to substract StatusBar.currentHeight (https://facebook.github.io/react-native/docs/statusbar.html#constants) on Android to adjust to the correct height

All 4 comments

I have this exact issue as well. Only on Android, not on iOS.

you have to substract StatusBar.currentHeight (https://facebook.github.io/react-native/docs/statusbar.html#constants) on Android to adjust to the correct height

Thanks @wizza-smile! This was exactly what I needed. I had hardcoded a value before but it felt really unsafe.

This is my implementation

selector: {
    ...Platform.select({
        android: {paddingBottom: StatusBar.currentHeight},
    }),
},

Thank you! ;)

Was this page helpful?
0 / 5 - 0 ratings