Skip to content
📂 utils for developing Iphone SE size
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
.gitignore
.npmignore make index.d.ts file for typescript usage and set files for publishin… Mar 6, 2019
.prettierrc make index.d.ts file for typescript usage and set files for publishin… Mar 6, 2019
LICENSE
README.md
index.d.ts
index.js
package.json

README.md

react-native-iphone-se-helper

This package was created with strong motivation for react-native-iphone-x-helper (author: ptelad)

install

yarn add react-native-iphone-se-helper
#or 
npm install react-native-iphone-se-helper --save

API

isIphoneSE(): boolean

returns whether the device is a iPhons SE or others

concernSESize(originalSize: number, seSize: number): number

determines the size by dividing whether it is SE or not

Example

import { isIphoneSE, concernSESize } from "react-native-iphone-se-helper";

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
    alignItems: "center",
    backgroundColor: "#F5FCFF"
  },
  welcome: {
    fontSize: concernSESize(20, 11),
    textAlign: "center",
    margin: isIphoneSE() ? 5 : 10
  },
  instructions: {
    textAlign: "center",
    color: "#333333",
    marginBottom: 5
  }
});

License

MIT

You can’t perform that action at this time.