React native 实战 --布局篇(mac)

RN的布局

  • RN的布局是组件化的方式进行组合布局,没有定义flex情况下的话,布局很随意

样式的坑

  • 要注意盒子之间是否使用了flex
  • flex:0 1 auto 是三种不一样的情况

能使用的属性

Valid style props: [
  "alignItems",

  "alignSelf",

  "backfaceVisibility",

  "backgroundColor",

  "borderBottomColor",

  "borderBottomLeftRadius",

  "borderBottomRightRadius",

  "borderBottomWidth",

  "borderColor",

  "borderLeftColor",

  "borderLeftWidth",

  "borderRadius",

  "borderRightColor",

  "borderRightWidth",

  "borderStyle",

  "borderTopColor",

  "borderTopLeftRadius",

  "borderTopRightRadius",

  "borderTopWidth",

  "borderWidth",

  "bottom",

  "color",

  "elevation",

  "flex",

  "flexDirection",

  "flexWrap",

  "fontFamily",

  "fontSize",

  "fontStyle",

  "fontWeight",

  "height",

  "justifyContent",

  "left",

  "letterSpacing",

  "lineHeight",

  "margin",

  "marginBottom",

  "marginHorizontal",

  "marginLeft",

  "marginRight",

  "marginTop",

  "marginVertical",

  "maxHeight",

 "maxWidth",

  "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"]
  • 不同的组件拥有的属性不一样
  • 比如 View不能定义 color等
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 移动开发基本知识点 一.使用rem作为单位 html { font-size: 100px; } @media(m...
    横冲直撞666阅读 3,552评论 0 6
  • H5移动端知识点总结 阅读目录 移动开发基本知识点 calc基本用法 box-sizing的理解及使用 理解dis...
    Mx勇阅读 4,668评论 0 26
  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    wzhiq896阅读 1,820评论 0 2
  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    love2013阅读 2,350评论 0 11
  • 作为一名大龄英语学习者每天需要一定量的听力和阅读输入,记录一下今日学习内容: 1.Englishpod1-100期...
    Cliff的自由之路阅读 560评论 0 1