美文网首页
React Native样式属性列表

React Native样式属性列表

作者: 阮腾飞 | 来源:发表于2016-07-04 20:30 被阅读1314次

          只要在样式表中书写一个不存在的样式,就会报一大堆错,提示你该样式不存在,然后提供所有可用的样式给你,如图:

    列出的即所有可用的属性

    "alignItems",

    "alignSelf",

    "backfaceVisibility",

    "backgroundColor",

    "borderBottomColor",

    "borderBottomLeftRadius",

    "borderBottomRightRadius",

    "borderBottomWidth",

    "borderColor",

    "borderLeftColor",

    "borderLeftWidth",

    "borderRadius",

    "borderRightColor",

    "borderRightWidth",

    "borderStyle",

    "borderTopColor",

    "borderTopLeftRadius",

    "borderTopRightRadius",

    "borderTopWidth",

    "borderWidth",

    "bottom",

    "color",

    "flex",

    "flexDirection",

    "flexWrap",

    "fontFamily",

    "fontSize",

    "fontStyle",

    "fontWeight",

    "height",

    "justifyContent",

    "left",

    "letterSpacing",

    "lineHeight",

    "margin",

    "marginBottom",

    "marginHorizontal",

    "marginLeft",

    "marginRight",

    "marginTop",

    "marginVertical",

    "opacity",

    "overflow",

    "padding",

    "paddingBottom",

    "paddingHorizontal",

    "paddingLeft",

    "paddingRight",

    "paddingTop",

    "paddingVertical",

    "position",

    "resizeMode",

    "right",

    "rotation",

    "scaleX",

    "scaleY",

    "shadowColor",

    "shadowOffset",

    "shadowOpacity",

    "shadowRadius",

    "textAlign",

    "textDecorationColor",

    "textDecorationLine",

    "textDecorationStyle",

    "tintColor",

    "top",

    "transform",

    "transformMatrix",

    "translateX",

    "translateY",

    "width",

    "writingDirection"

    样式的使用:

    一种是采用StyleSheet的方式,还有一种是直接写在Components里面

    Style是常见的方式,如新创建的项目里所示:

    这种方式可以支持样式数组,一个Component可以同时使用多个Style

    这个里面也可以根据某些条件来展示样式,比如说一个按钮在可用的时候是一个样式,在不可用的时候是另一个样式。

    直接写在Component里面,如下所示:

    相关文章

      网友评论

          本文标题:React Native样式属性列表

          本文链接:https://www.haomeiwen.com/subject/gxqhjttx.html