React Native fixed footer

后端 未结 20 1514
南旧
南旧 2020-12-22 16:57

I try to create react native app that looks like existing web app. I have a fixed footer at bottom of window. Do anyone have idea how this can be achieved with react native?

20条回答
  •  南方客
    南方客 (楼主)
    2020-12-22 17:28

    import {Dimensions} from 'react-native'
    
    const WIDTH = Dimensions.get('window').width;
    const HEIGHT = Dimensions.get('window').height;
    

    then on the write this styles

     position: 'absolute',
     top: HEIGHT-80,
     left: 0,
     right: 0,
    

    worked like a charm

提交回复
热议问题