RN 踩坑:内容区域高度

栏目: IOS · 发布时间: 7年前

内容简介:Dimensions 获取的是设备屏幕分辨率对应的宽高,包含了 status bar 以及其它 bar.ios 比较简单,就一个 statusBar,iphoneX 是一类,其它的是一类,使用 paddingTop 可抵消 statusBar,项目使用 native-base 的 header,设置如下:android 有三种 bar:Soft menu, Status bar, Smart bar,其中,Smart bar 为魅族特有。在使用内容区域高度时需要考虑以上三种 bar。当然,工具已经有人做好

Dimensions 获取的是设备屏幕分辨率对应的宽高,包含了 status bar 以及其它 bar.

ios

ios 比较简单,就一个 statusBar,iphoneX 是一类,其它的是一类,使用 paddingTop 可抵消 statusBar,项目使用 native-base 的 header,设置如下:

paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0
height: platform === "ios" ? (isIphoneX ? 88 : 64) : 56
复制代码

android

android 有三种 bar:Soft menu, Status bar, Smart bar,其中,Smart bar 为魅族特有。在使用内容区域高度时需要考虑以上三种 bar。当然,工具已经有人做好了: github.com/Sunhat/reac…


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

An Introduction to the Analysis of Algorithms

An Introduction to the Analysis of Algorithms

Robert Sedgewick、Philippe Flajolet / Addison-Wesley Professional / 1995-12-10 / CAD 67.99

This book is a thorough overview of the primary techniques and models used in the mathematical analysis of algorithms. The first half of the book draws upon classical mathematical material from discre......一起来看看 《An Introduction to the Analysis of Algorithms》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具