Skip to content

React Native 不同设备分辨率适配和设计稿尺寸单位 px 适配

License

Notifications You must be signed in to change notification settings

maoweipeng/react-native-scale-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-scale-view

React Native 不同设备分辨率适配和设计稿尺寸单位 px 适配

Getting started

Install the library using either Yarn:

yarn add react-native-scale-view

or npm:

npm install --save react-native-scale-view

Using React Native >= 0.60

Usage Example

import ScaleView from 'react-native-scale-view';

const App = () => {
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <ScaleView designWidth={750}>
          {/* page */}
        </ScaleView>
      </SafeAreaView>
    </>
  );
};

Props

Props Description Type Default
designWidth 设计稿宽 number 750

About

React Native 不同设备分辨率适配和设计稿尺寸单位 px 适配

Resources

License

Stars

Watchers

Forks

Packages

No packages published