日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

React Native StyleSheet 样式属性

發(fā)布時(shí)間:2025/3/20 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 React Native StyleSheet 样式属性 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

簡(jiǎn)介

React Native StyleSheet 提供一系類的對(duì)樣式(類似css)屬性。

其中包括

  • Layout 布局相關(guān)的
  • transform 改變相關(guān)的
  • shadow 陰影相關(guān)的
  • View 視圖相關(guān)的
  • text 文本相關(guān)的
  • image 圖片相關(guān)的
  • DangerouslyImprecise 相關(guān)的

Layout 布局相關(guān)的

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 改變相關(guān)的

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 陰影相關(guān)的

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

View 視圖相關(guān)的

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 文本相關(guān)

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 圖片相關(guān)的

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

DangerouslyImprecise 相關(guān)的

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

轉(zhuǎn)載于:https://my.oschina.net/bosscheng/blog/2253238

總結(jié)

以上是生活随笔為你收集整理的React Native StyleSheet 样式属性的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。