美文网首页
react native高度总结

react native高度总结

作者: nonooon | 来源:发表于2019-11-26 10:32 被阅读0次

const dHeight = Dimensions.get('window').height;

const dWidth = Dimensions.get('window').width;

const sHeight = Dimensions.get('screen').height;

const sWidth = Dimensions.get('screen').width;

状态栏高度:statusBarHeight

安卓底部虚拟导航条高度:botNavHeight

应用显示高度:aHeight

对于iOS:

dHeight = sHeight

dWidth = sWidth

dHeight = statusBarHeight + aHeight

对于安卓:

  非全面屏:

  dHeight = statusBarHeight + aHeight

  sHeight = dHeight + botNavHeight

  dWidth = sWidth

  全面屏:

  dHeight = aHeight

  sHeight = statusBarHeight+ dHeight + botNavHeight

  dWidth = sWidt

相关文章

网友评论

      本文标题:react native高度总结

      本文链接:https://www.haomeiwen.com/subject/suhewctx.html