项目作者: chilijung

项目描述 :
classify mobile device size in react-native
高级语言: JavaScript
项目地址: git://github.com/chilijung/react-native-device-size.git
创建时间: 2017-08-07T08:54:51Z
项目社区:https://github.com/chilijung/react-native-device-size

开源协议:

下载


react-native-device-size

Build Status

classify mobile device size in react-native.

Usage

  1. import deviceSize from 'react-native-device-size';
  2. console.log(deviceSize); // return one of xsmall, small, normal, large, xlarge

Device size category

iOS and android use different standard to classify, iOS use iphone versions, and android use official classification .

According to the documents:

  • xlarge screens are at least 960dp x 720dp
  • large screens are at least 640dp x 480dp
  • normal screens are at least 470dp x 320dp
  • small screens are at least 426dp x 320dp

xsmall

  • iOS: iphone 4
  • android: less than 426dp x 320dp

small

  • iOS: iphone 5
  • android: less than 470dp x 320dp

normal

  • iOS: iphone 6
  • android: less than 640dp x 480dp

large

  • iOS: iphone 6 plus
  • android: less than 960dp x 720dp

xlarge

  • iOS: larger than iphone 6 plus
  • android: larger than 960dp x 720dp

Device Metric

https://material.io/devices/

License

MIT