Commit 96a5af79 by wong.peiyi

ios状态栏高度修改

parent 10012595
...@@ -4,7 +4,7 @@ import {isIphoneX} from '../../utils/Utils' ...@@ -4,7 +4,7 @@ import {isIphoneX} from '../../utils/Utils'
import {connect} from "react-redux"; import {connect} from "react-redux";
const iosStatusBarHeight = 20; const iosStatusBarHeight = 20;
const iosStatusBarXHeight = 44; const iosStatusBarXHeight = 48;
const PropTypes = require('prop-types'); const PropTypes = require('prop-types');
class StatusBarView extends Component { class StatusBarView extends Component {
...@@ -23,7 +23,6 @@ class StatusBarView extends Component { ...@@ -23,7 +23,6 @@ class StatusBarView extends Component {
render() { render() {
let height = 0 let height = 0
if (Platform.OS == 'ios') { if (Platform.OS == 'ios') {
if (this.props.isReactStackNavigator) { if (this.props.isReactStackNavigator) {
height = isIphoneX() ? iosStatusBarXHeight : iosStatusBarHeight height = isIphoneX() ? iosStatusBarXHeight : iosStatusBarHeight
......
...@@ -50,8 +50,11 @@ export const isEmpty = (data) => { ...@@ -50,8 +50,11 @@ export const isEmpty = (data) => {
const X_WIDTH = 375; const X_WIDTH = 375;
const X_HEIGHT = 812; const X_HEIGHT = 812;
const XS_MAX_WIDTH = 414; const X_MAX_WIDTH = 414;
const XS_MAX_HEIGHT = 896; const X_MAX_HEIGHT = 896;
const XS_MAX_WIDTH = 428;
const XS_MAX_HEIGHT = 926;
const screenW = Dimensions.get('window').width; const screenW = Dimensions.get('window').width;
const screenH = Dimensions.get('window').height; const screenH = Dimensions.get('window').height;
...@@ -60,6 +63,7 @@ export const isIphoneX = () => { ...@@ -60,6 +63,7 @@ export const isIphoneX = () => {
return ( return (
Platform.OS === 'ios' && Platform.OS === 'ios' &&
((screenH === X_HEIGHT && screenW === X_WIDTH) || ((screenH === X_HEIGHT && screenW === X_WIDTH) ||
(screenH === X_MAX_HEIGHT && screenW === X_MAX_WIDTH) ||
(screenH === XS_MAX_HEIGHT && screenW === XS_MAX_WIDTH)) (screenH === XS_MAX_HEIGHT && screenW === XS_MAX_WIDTH))
) )
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment