![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-native-worry-free-style-sheet
Advanced tools
一个省心的React-Native StyleSheet工具方法
yarn add react-native-worry-free-style-sheet
import StyleSheet, { IgnoreValue } from 'react-native-worry-free-style-sheet';
const styles = StyleSheet.create({
container: {
flex: 1,
},
box1: {
marginTop: 50,
width: 375,
height: new IgnoreValue(30),
backgroundColor: 'red',
borderWidth: 0.6,
borderColor: 'red',
borderRadius: 20,
marginLeft: 10,
},
text: {
fontSize: 15,
},
});
import StyleSheet from 'react-native-worry-free-style-sheet';
StyleSheet.setConfig({
baseWidth: 750,
});
包含默认StyleSheet的方法
方法/常量 | 参数类型 | 描述 |
---|---|---|
scaleSize | number | 屏幕适配, 缩放size , 默认根据宽度适配,纵向也可以使用此方法 |
setConfig | { baseWidth } | 修改配置 |
IgnoreValue | new IgnoreValue(100) | 忽略转换 |
isIphoneX | 判断是否为iphoneX | |
ifIphoneX | iphoneXStyle,iosStyle,androidStyle | 根据是否是iPhoneX返回不同的样式 |
statusBarHeight | 状态栏高度 | |
navigationBarHeight | 常规导航栏高度(包含状态栏) | |
navBarHeight | 状态栏加导航栏的高度 | |
navBarUnlessStatusHeight | 导航栏高度(不包含状态栏) | |
getBottomSpace | 获取底部边距 | |
onePixel | 常量 | 1个像素 |
screenW | 常量 | 屏幕宽度 |
screenH | 常量 | 屏幕高度 |
isIOS | 常量 | 是否 iOS |
isAndroid | 常量 | 是否 Android |
const transformKeys = {
fontSize: true,
width: true,
height: true,
start: true,
end: true,
top: true,
left: true,
right: true,
bottom: true,
minWidth: true,
maxWidth: true,
minHeight: true,
maxHeight: true,
margin: true,
marginVertical: true,
marginHorizontal: true,
marginTop: true,
marginBottom: true,
marginLeft: true,
marginRight: true,
marginStart: true,
marginEnd: true,
padding: true,
paddingVertical: true,
paddingHorizontal: true,
paddingTop: true,
paddingBottom: true,
paddingLeft: true,
paddingRight: true,
paddingStart: true,
paddingEnd: true,
lineHeight: true,
borderRadius: true,
borderWidth: true,
borderTopWidth: true,
borderStartWidth: true,
borderEndWidth: true,
borderRightWidth: true,
borderBottomWidth: true,
borderLeftWidth: true,
borderBottomEndRadius: true,
borderBottomLeftRadius: true,
borderBottomRightRadius: true,
borderBottomStartRadius: true,
borderTopEndRadius: true,
borderTopLeftRadius: true,
borderTopRightRadius: true,
borderTopStartRadius: true,
};
FAQs
省心的React-Native StyleSheet工具方法
We found that react-native-worry-free-style-sheet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.