项目作者: buraksakalli

项目描述 :
Easy way to React Native aspect ratio calculator
高级语言: JavaScript
项目地址: git://github.com/buraksakalli/react-native-aspect-ratio.git
创建时间: 2020-08-21T06:39:28Z
项目社区:https://github.com/buraksakalli/react-native-aspect-ratio

开源协议:MIT License

下载


React Native Aspect Ratio Calculator

aspect-ratio

GitHub issues
npm (scoped)

Installation

  1. npm i react-native-aspect-ratio

Usage

Import the module

  1. import { Screen } from "react-native-aspect-ratio";

Config

Set an width/height

  1. // You can use in your style.
  2. height: Screen.setDimension(90, "h", {411, 736}), // x, y values of designed component. x: 411, y: 736
  3. width: Screen.setDimension(80, 'w', {411, 736}),

Get full width/height

Returns screen width and height.

  1. height: Screen.getDimension().height,
  2. width: Screen.getDimension().width,