我在哪里可以获得React Native为每种类型组件支持的样式属性列表?我在哪里可以找到反应原生支持的所有样式属性列表?
回答
这里的cheatsheet文件:
支持的样式包括每个组件的官方文档。下面是View
链接和Text
组件:
View
:https://facebook.github.io/react-native/docs/view.html#styleText
:https://facebook.github.io/react-native/docs/text.html#style
注意的地方说:视图样式道具...上的样式顶部文本,这意味着它也支持(大部分)View
支持的样式。
我已经从反应原生日志中提取了有效样式列表。
下面的集合帮助我在日常工作中很多。
[
"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"
]
实现细节在这里: https://github.com/vhpoet/react-native-styling-cheat-sheet/blob/master/README.md
-1;目前还不清楚这份清单是从哪里来的(所以我们甚至无法确信它是正确的),再加上没有迹象表明如何为未来版本进行更新,再加上这个答案有点误导新手,因为它没有注意到不同的样式规则适用于不同的组件。 –
@MarkAmery正如我已经明确提到,我从日志中获得列表,每个人都可以找到这些有效的样式属性。 一套规则可以在这里找到: https://github.com/vhpoet/react-native-styling-cheat-sheet/blob/master/README.md – Ahsanwarsi
*什么*日志?也许我错过了一些明显的东西,但我不知道你的意思。 –
- 1. 我在哪里可以找到支持的注册变量的属性列表?
- 2. 我在哪里可以找到OSX支持的所有表情符号列表
- 3. 我在哪里可以找到Transformer.setOutputProperty的属性列表?
- 4. 我在哪里可以获得AUTOCAD所有支持的格式?
- 5. 我在哪里可以找到Android样式项目列表?
- 6. 我在哪里可以找到属性名称列表?
- 7. 我在哪里可以找到所有PHP函数的列表?
- 8. 我在哪里可以找到列出控件中所有状态的属性?
- 9. 我在哪里可以找到setStyle(样式,值)的样式列表?
- 10. 我在哪里可以找到谷歌地图的样式表
- 11. 我在哪里可以获得所有支持的phonegap config.xml首选项列表?
- 12. 我在哪里可以找到Google Translate API支持的语言列表?
- 13. 我在哪里可以找到VSCode支持的JS模块列表?
- 14. 我在哪里可以找到Android官方支持的mimetypes列表?
- 15. 我可以动态更改原生反应中的样式属性吗?
- 16. 我在哪里可以找到kernel32.dll支持的api?
- 17. 我在哪里可以找到支持此行为的文档?
- 18. 我在哪里可以找到支持OAuth 2.0的.NET OAuth库?
- 19. 我在哪里可以找到的android-V7支持库JAR
- 20. 在哪里可以找到Spring Boot中YAML的默认支持属性?
- 21. 在哪里可以找到所有jQuery事件的列表?
- 22. 我在哪里可以找到jQuery UI的所有属性。项目
- 23. 我在哪里可以找到jQuery元素的所有CSS属性?
- 24. 我在哪里可以找到支持android
- 25. 我在哪里可以找到taglib-sharp支持的所有音频文件类型列表?
- 26. 我在哪里可以找到所有可用的Xulrunner偏好列表?
- 27. 我在哪里可以找到sapui5中所有可用XML元素的列表?
- 28. 我在哪里可以找到wxPython函数的所有可能参数列表?
- 29. 反应原生:“订单”不是有效的样式属性
- 30. 我在哪里可以找到plothover函数中'item'的属性列表?
这并不总是存在的,如G。 [TouchableHighlight](https://facebook.github.io/react-native/docs/touchablehighlight.html#style)为空。 –