1.0.3 • Published 4 years ago
react-native-stylesheet-adapter v1.0.3
react-native-stylesheet-adapter
适配ios和android终端不同尺寸
react-native-stylesheet-adapter的安装和使用
安装
在react中使用先安装 yarn add react-native-web(react native中直接无需安装)
yarn add react-native-stylesheet-adapter
初始化
import {StyleSheet} from 'react-native-stylesheet-adapter';
StyleSheet使用
//_height 代表android尺寸
//height 代表ios尺寸
const styles = StyleSheet.create({
test:{
_height:20,
height:22.5,
width:100,
_width:120
}
})