React Native 的 Flex 布局重点

作者: wg689 | 来源:发表于2019-08-04 20:12 被阅读3次

样式

Flexbox

属性

Edit on GitHub

alignItems enum('flex-start', 'flex-end', 'center', 'stretch')

alignSelf enum('auto', 'flex-start', 'flex-end', 'center', 'stretch')

borderBottomWidth 数值型

**borderLeftWidth **数值型

borderRightWidth 数值型

borderTopWidth 数值型

borderWidth 数值型

**bottom **数值型

**flex **数值型

**flexDirection **enum('row', 'column')

**flexWrap **enum('wrap', 'nowrap')

height 数值型

justifyContent enum('flex-start', 'flex-end', 'center', 'space-between', 'space-around')

**left **数值型

**margin **数值型

marginBottom 数值型

marginHorizontal 数值型

marginLeft 数值型

**marginRight **数值型

marginTop 数值型

**marginVertical **数值型

**padding **数值型

**paddingBottom **数值型

paddingHorizontal 数值型

paddingLeft 数值型

paddingRight 数值型

paddingTop 数值型

**paddingVertical **数值型

**position **enum('absolute', 'relative')

right 数值型

**top **数值型

**width **数值型

属性 含义
flex-direction 方向
flex-wrap 换行
flex-flow 上面两个的简写
justify-content 主轴方向对齐方式
align-items 侧轴对齐方式
align-content 多行/列内容对齐方式(用的较少)

align-self

align-self 属性规定灵活容器内被选中项目的对齐方式。
auto 默认值。元素继承了它的父容器的 align-items 属性。如果没有父容器则为 "stretch"。

stretch 元素被拉伸以适应容器。

center 元素位于容器的中心。

flex-start 元素位于容器的开头。

flex-end 元素位于容器的结尾。

baseline 元素位于容器的基线上。

initial 设置该属性为它的默认值。

inherit 从父元素继承该属性。

最佳flex 布局文章推荐:

Reac-Native布局详细指南
http://www.devio.org/2016/08/01/Reac-Native布局详细指南/

布局练习demo
‎⁨Macintosh HD⁩ ▸ ⁨用户⁩ ▸ ⁨wanggang⁩ ▸ ⁨react02⁩MyApp2233

相关文章

  • 03-Flexible Box

    概念 React-Native 中所有的布局均采用 Flex 布局。采用 Flex 布局的元素,称为 Flex 容...

  • Flex布局

    flex布局前提条件--display: flex(react native 不用设置) 与flex布局相关的属性...

  • React Native学习资料

    React 入门实例教程React-Native入门指南Flex 布局教程:语法篇React Native探索(二...

  • Flex布局

    Flex Flex:弹性布局 React Native 的默认布局是flex布局 如果将父元素设置成弹性盒模型模式...

  • React Native - Flex布局

    React Native - Flex布局 Flex布局概述 概念:弹性盒子布局 历史:性盒模型,该布局方案由W3...

  • React Native 的 Flex 布局重点

    样式 Flexbox 下一节 上一节 属性 Edit on GitHub alignItems enum('fle...

  • 绿侠快充App技术整理

    React Native 原理 ES6 Flex 布局 React Navigation MobX 视频教程 网...

  • React之Flex

    react native 的flex布局,是web的阉割版本,目前还不支持flex-shrink、flex-bas...

  • React-Native flex 布局使用总结

    React Native flex 布局使用总结 父视图属性(容器属性): flexDirection : 对子...

  • react native布局小知识之主次轴,排列方式

    react native布局小知识之主次轴,排列方式 在react native中,我们使用方便快捷的Flex B...

网友评论

    本文标题:React Native 的 Flex 布局重点

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