在哪里可以找到react native支持的所有样式属性列表?

o0o*_*o0o 24 react-native

在哪里可以获得React Native支持的每种类型组件的样式属性列表?

nab*_*abn 36

这是一张备忘单:

支持的样式位于每个组件的官方文档中.以下是链接ViewText组件:

请注意,在Text的样式顶部显示View Style Props ...,这意味着它还支持(大多数)View支持的样式.

  • 它并不总是在那里,例如[TouchableHighlight](https://facebook.github.io/react-native/docs/touchablehighlight.html#style)为空。 (2认同)

Ahs*_*rsi 12

我从react本机日志中提取了一个有效样式列表.

以下收藏在常规工作中帮助我很多.

[
  "alignContent",
  "alignItems",
  "alignSelf",
  "aspectRatio",
  "backfaceVisibility",
  "backgroundColor",
  "borderBottomColor",
  "borderBottomLeftRadius",
  "borderBottomRightRadius",
  "borderBottomWidth",
  "borderColor",
  "borderLeftColor",
  "borderLeftWidth",
  "borderRadius",
  "borderRightColor",
  "borderRightWidth",
  "borderStyle",
  "borderTopColor",
  "borderTopLeftRadius",
  "borderTopRightRadius",
  "borderTopWidth",
  "borderWidth",
  "bottom",
  "color",
  "decomposedMatrix",
  "direction",
  "display",
  "elevation",
  "flex",
  "flexBasis",
  "flexDirection",
  "flexGrow",
  "flexShrink",
  "flexWrap",
  "fontFamily",
  "fontSize",
  "fontStyle",
  "fontVariant",
  "fontWeight",
  "height",
  "includeFontPadding",
  "justifyContent",
  "left",
  "letterSpacing",
  "lineHeight",
  "margin",
  "marginBottom",
  "marginHorizontal",
  "marginLeft",
  "marginRight",
  "marginTop",
  "marginVertical",
  "maxHeight",
  "maxWidth",
  "minHeight",
  "minWidth",
  "opacity",
  "overflow",
  "overlayColor",
  "padding",
  "paddingBottom",
  "paddingHorizontal",
  "paddingLeft",
  "paddingRight",
  "paddingTop",
  "paddingVertical",
  "position",
  "resizeMode",
  "right",
  "rotation",
  "scaleX",
  "scaleY",
  "shadowColor",
  "shadowOffset",
  "shadowOpacity",
  "shadowRadius",
  "textAlign",
  "textAlignVertical",
  "textDecorationColor",
  "textDecorationLine",
  "textDecorationStyle",
  "textShadowColor",
  "textShadowOffset",
  "textShadowRadius",
  "tintColor",
  "top",
  "transform",
  "transformMatrix",
  "translateX",
  "translateY",
  "width",
  "writingDirection",
  "zIndex"
]
Run Code Online (Sandbox Code Playgroud)

实施细节如下:https: //github.com/vhpoet/react-native-styling-cheat-sheet/blob/master/README.md

  • -1; 目前还不清楚这个清单的来源(所以我们甚至不能确信这是正确的),而且没有迹象表明如何更新它以供将来的版本使用,而且这个答案对新手来说有点误导,因为它没有注意到不同的样式规则适用于不同的组件. (3认同)
  • *什么*日志?也许我错过了一些明显的东西,但我不知道你的意思。 (2认同)