2019独角兽企业重金招聘Python工程师标准>>>

简介

React Native StyleSheet 提供一系类的对样式(类似css)属性。

其中包括

  • Layout 布局相关的
  • transform 改变相关的
  • shadow 阴影相关的
  • View 视图相关的
  • text 文本相关的
  • image 图片相关的
  • DangerouslyImprecise 相关的

Layout 布局相关的

export type LayoutStyle = $ReadOnly<{|display?: 'none' | 'flex',width?: DimensionValue,height?: DimensionValue,bottom?: DimensionValue,end?: DimensionValue,left?: DimensionValue,right?: DimensionValue,start?: DimensionValue,top?: DimensionValue,minWidth?: DimensionValue,maxWidth?: DimensionValue,minHeight?: DimensionValue,maxHeight?: DimensionValue,margin?: DimensionValue,marginBottom?: DimensionValue,marginEnd?: DimensionValue,marginHorizontal?: DimensionValue,marginLeft?: DimensionValue,marginRight?: DimensionValue,marginStart?: DimensionValue,marginTop?: DimensionValue,marginVertical?: DimensionValue,padding?: DimensionValue,paddingBottom?: DimensionValue,paddingEnd?: DimensionValue,paddingHorizontal?: DimensionValue,paddingLeft?: DimensionValue,paddingRight?: DimensionValue,paddingStart?: DimensionValue,paddingTop?: DimensionValue,paddingVertical?: DimensionValue,borderWidth?: number,borderBottomWidth?: number,borderEndWidth?: number,borderLeftWidth?: number,borderRightWidth?: number,borderStartWidth?: number,borderTopWidth?: number,position?: 'absolute' | 'relative',flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse',flexWrap?: 'wrap' | 'nowrap',justifyContent?:| 'flex-start'| 'flex-end'| 'center'| 'space-between'| 'space-around'| 'space-evenly',alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline',alignSelf?:| 'auto'| 'flex-start'| 'flex-end'| 'center'| 'stretch'| 'baseline',alignContent?:| 'flex-start'| 'flex-end'| 'center'| 'stretch'| 'space-between'| 'space-around',overflow?: 'visible' | 'hidden' | 'scroll',flex?: number,flexGrow?: number,flexShrink?: number,flexBasis?: number | string,aspectRatio?: number,zIndex?: number,direction?: 'inherit' | 'ltr' | 'rtl',
|}>;

transform 改变相关的

export type TransformStyle = $ReadOnly<{|transform?: $ReadOnlyArray<| {|+perspective: number | AnimatedNode|}| {|+rotate: string|}| {|+rotateX: string|}| {|+rotateY: string|}| {|+rotateZ: string|}| {|+scale: number | AnimatedNode|}| {|+scaleX: number | AnimatedNode|}| {|+scaleY: number | AnimatedNode|}| {|+translateX: number | AnimatedNode|}| {|+translateY: number | AnimatedNode|}| {|+translate: [number | AnimatedNode, number | AnimatedNode] | AnimatedNode,|}| {|+skewX: string|}| {|+skewY: string|}// TODO: what is the actual type it expects?| {|+matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,|},>,
|}>;

shadow 阴影相关的

export type ShadowStyle = $ReadOnly<{|shadowColor?: ColorValue,shadowOffset?: $ReadOnly<{|width?: number,height?: number,|}>,shadowOpacity?: number | AnimatedNode,shadowRadius?: number,
|}>;

View 视图相关的

export type ViewStyle = $ReadOnly<{|...$Exact<LayoutStyle>,...$Exact<ShadowStyle>,...$Exact<TransformStyle>,backfaceVisibility?: 'visible' | 'hidden',backgroundColor?: ColorValue,borderColor?: ColorValue,borderBottomColor?: ColorValue,borderEndColor?: ColorValue,borderLeftColor?: ColorValue,borderRightColor?: ColorValue,borderStartColor?: ColorValue,borderTopColor?: ColorValue,borderRadius?: number,borderBottomEndRadius?: number,borderBottomLeftRadius?: number,borderBottomRightRadius?: number,borderBottomStartRadius?: number,borderTopEndRadius?: number,borderTopLeftRadius?: number,borderTopRightRadius?: number,borderTopStartRadius?: number,borderStyle?: 'solid' | 'dotted' | 'dashed',borderWidth?: number,borderBottomWidth?: number,borderEndWidth?: number,borderLeftWidth?: number,borderRightWidth?: number,borderStartWidth?: number,borderTopWidth?: number,opacity?: number | AnimatedNode,elevation?: number,
|}>;

text 文本相关

export type TextStyle = $ReadOnly<{|...$Exact<ViewStyle>,color?: ColorValue,fontFamily?: string,fontSize?: number,fontStyle?: 'normal' | 'italic',fontWeight?:| 'normal'| 'bold'| '100'| '200'| '300'| '400'| '500'| '600'| '700'| '800'| '900',fontVariant?: $ReadOnlyArray<| 'small-caps'| 'oldstyle-nums'| 'lining-nums'| 'tabular-nums'| 'proportional-nums',>,textShadowOffset?: $ReadOnly<{|width?: number,height?: number,|}>,textShadowRadius?: number,textShadowColor?: ColorValue,letterSpacing?: number,lineHeight?: number,textAlign?: 'auto' | 'left' | 'right' | 'center' | 'justify',textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center',includeFontPadding?: boolean,textDecorationLine?:| 'none'| 'underline'| 'line-through'| 'underline line-through',textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed',textDecorationColor?: ColorValue,writingDirection?: 'auto' | 'ltr' | 'rtl',
|}>;

image 图片相关的

export type ImageStyle = $ReadOnly<{|...$Exact<ViewStyle>,resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',tintColor?: ColorValue,overlayColor?: string,
|}>;

DangerouslyImprecise 相关的

export type DangerouslyImpreciseStyle = {...$Exact<TextStyle>,+resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',+tintColor?: ColorValue,+overlayColor?: string,
};

转载于:https://my.oschina.net/bosscheng/blog/2253238

React Native StyleSheet 样式属性相关推荐

  1. React Native之Props(属性)和State(状态)和简单样式简单使用

    1    Props(属性)和State(状态)和简单样式简单使用App.js代码如下 /*** Sample React Native App* https://github.com/faceboo ...

  2. React Native中pointerEvent属性

    在React Native界面开发中, 如果使用绝对定位布局,在代码运行时的某个时刻有可能会遮盖住它的下方的某个组件.这是因为绝对定位只是说这个组件的位置由它父组件的边框决定. 绝对定位的组件可以被认 ...

  3. React Native之样式

    样式 React Native 不实现 CSS,而是依赖于 JavaScript 来为你的应用程序设置样式.这是一个有争议的决定,你可以阅读那些幻灯片,了解背后的基本原理. 声明样式

  4. React Native Styling:样式化的组件,Flexbox布局等

    React Native provides an API for creating stylesheets and styling your components: StyleSheet. React ...

  5. 从零学React Native之07View

    View 组件是React Native最基本的组件.绝大部分其他React Native 组件. View组件的颜色和边框 backgroundColor 键用来指定颜色. RN 0.19版本开始, ...

  6. React Native基础入门教程:初步使用Flexbox布局

    一.长度的单位 在开始任何布局之前,让我们来首先需要知道,在写React Native组件样式时,长度的不带单位的,它表示"与设备像素密度无关的逻辑像素点". 这个怎么理解呢? 我 ...

  7. 构建了我的第一个React Native应用程序之后,我现在确信这是未来。

    by Taylor Milliman 泰勒·米利曼(Taylor Milliman) 构建了我的第一个React Native应用程序之后,我现在确信这是未来. (After building my ...

  8. 给所有开发者的React Native详细入门指南

    本文为 Marno 原创,转载必须保留出处! 公众号[ aMarno ],关注后回复 RN 加入交流群 React Native 优秀开源项目大全:http://www.marno.cn 建议先下载好 ...

  9. React Native知识

    http://www.cnblogs.com/wujy/tag/React%20Native/  React Native知识12-与原生交互 React Native知识11-Props(属性)与S ...

最新文章

  1. Asp.Net 构架(HttpModule 介绍)
  2. apache评分表的意义_APACHE评分系统及评分表
  3. bzoj2588: Spoj 10628. Count on a tree(树上第k大)(主席树)
  4. 视频隐身衣:物体移除、去水印、后期处理毫无痕迹
  5. Spring源码分析-循环依赖
  6. Android 系统(257)---Launcher显示未读通知的数量
  7. 视频编解码(十三):list_for_each_entry列表总结
  8. 牛客网华为机试题java,华为机试题
  9. 螺钉螺母匹配问题---快速排序
  10. PS CC 2014破解版
  11. 【爬虫1】爬虫和反爬虫介绍
  12. 基于python的酒店管理系统_基于Web酒店管理系统的设计与实现
  13. creator贴图纹理压缩(creator2.4.x 实现ETC2和ASTC)
  14. 数据库应用系统的四个层次划分
  15. iPhone无法联网问题
  16. 2023浙江师范大学计算机考研信息汇总
  17. linux运维基础[系统磁盘管理]——————存储设备的识别、df、du、fsck
  18. 详解163、CN2-GT和CN2-GIA的区别
  19. 数理统计方差齐性检验Python实现
  20. C#毕业设计——基于C#+vc.net+Access的报名管理信息系统设计与实现(毕业论文+程序源码)——报名管理信息系统

热门文章

  1. 服务器弱口令修改,Tomcat服务器弱口令漏洞攻击实验
  2. java8避免null_在 Java 8 中避免 Null 检查
  3. python 3 5的值_python3 语言特性5
  4. linux下怎样查看环境变量,Linux下查看和添加环境变量(示例代码)
  5. 和方舟rust一样的手游_三大高人气手游盘点,《方舟:生存进化》的世界靠支配恐龙来生存...
  6. 【杂谈】从学员到开发者,我在有三AI打怪升级
  7. 【直播回放】60分钟了解各类图像和视频生成GAN结构
  8. 在iptables防火墙下开启vsftpd的端口
  9. Windows 下单机最大TCP连接数
  10. windows下使用pip安装Python Web框架webpy