Code Monkey home page Code Monkey logo

Comments (8)

LoKiLyn avatar LoKiLyn commented on June 9, 2024 8

index.js didn't provide iPhone12 series support.

const X_WIDTH = 375;
const X_HEIGHT = 812;
const XSMAX_WIDTH = 414;
const XSMAX_HEIGHT = 896;
const PAD_WIDTH = 768;
const PAD_HEIGHT = 1024;

const IPHONE12_H = 844;
const IPHONE12_Max = 926;
const IPHONE12_Mini = 780;


const { height: D_HEIGHT, width: D_WIDTH } = Dimensions.get('window');

const { PlatformConstants = {} } = NativeModules;
const { minor = 0 } = PlatformConstants.reactNativeVersion || {};

const isIPhoneX = (() => {
  if (Platform.OS === 'web') return false;

  return (
    Platform.OS === 'ios' &&
    ((D_HEIGHT === X_HEIGHT && D_WIDTH === X_WIDTH) ||
      (D_HEIGHT === X_WIDTH && D_WIDTH === X_HEIGHT)) ||
    ((D_HEIGHT === XSMAX_HEIGHT && D_WIDTH === XSMAX_WIDTH) ||
          (D_HEIGHT === XSMAX_WIDTH && D_WIDTH === XSMAX_HEIGHT)) ||
      (D_HEIGHT === IPHONE12_H) || (D_HEIGHT === IPHONE12_Max) || (D_HEIGHT === IPHONE12_Mini)
  );
})();

Add some iPhone12 related adjustments to index.js will solve the issue.

using:
react-native-safe-area-view": "0.11.0

from react-native-safe-area-view.

sebastianor avatar sebastianor commented on June 9, 2024 1

Okay, I got it. I had custom height of the header that's why it didn't work after update libraries. Thank You for answer 😄

from react-native-safe-area-view.

vitalyrotari avatar vitalyrotari commented on June 9, 2024

same problem with react-navigation v4

from react-native-safe-area-view.

sebastianor avatar sebastianor commented on June 9, 2024

Same here for react-navigation v4 and:
"react-native-safe-area-context": "^1.0.2",
"react-native-safe-area-view": "^2.0.0",

from react-native-safe-area-view.

Abhishek-Sankey avatar Abhishek-Sankey commented on June 9, 2024

Screenshot 1942-08-15 at 6 51 40 PM
I've solved the issue by updating these 3 libraries.
Closing this issue now.
Let me know if anyone faces any issue.

from react-native-safe-area-view.

sebastianor avatar sebastianor commented on June 9, 2024

@Abhishek-Sankey are You using react-navigation v5 or v4 ?

from react-native-safe-area-view.

Abhishek-Sankey avatar Abhishek-Sankey commented on June 9, 2024

@Abhishek-Sankey are You using react-navigation v5 or v4 ?

it's v4

from react-native-safe-area-view.

luatnd avatar luatnd commented on June 9, 2024

Any solution on react-navigation v3?
I think I would follow @LoKiLyn 's solution

from react-native-safe-area-view.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.