-
Notifications
You must be signed in to change notification settings - Fork 257
Layout Attributes
zhenglibao edited this page Oct 24, 2020
·
7 revisions
- enumeration: the value can be one of the list
- layout value: the value can be number or percentage, or none to remove, or auto
- number value: the value must be number
- @ is special attribute, the value should be filename/stylename. It can be used to reference style in other style file.
- direction: inherit/ltr/rtl
- flexDirection: col/col-reverse/row/row-reverse
- justifyContent: flex-start/center/ flex-end/ space-between/ space-around / space-evenly
- alignContent: auto/ flex-start/ center/ flex-end/ stretch/ baseline/ space-between/ space-around/
- alignItems: auto/ flex-start/ center/ flex-end/ stretch/ baseline/ space-between/ space-around/
- alignSelf: auto/ flex-start/ center/ flex-end/ stretch/ baseline/ space-between/ space-around/
- position: relative/ absolute
- flexWrap: no-wrap/ wrap/ wrap-reverse
- overflow: visible/ hidden/ scroll
- display: flex/ none
- flex
- flexGrow
- flexShrink
- aspectRatio 宽高比
// flexBasis、width和height除了可以设置数值、百分比类型外,还可以设置为auto来恢复为默认值
- flexBasis
- width
- height
//以下值除了可以设置数值、百分比外,还可以设置为none来取消恢复为默认设置
- minWidth
- minHeight
- maxWidth
- maxHeight
- left
- top
- right
- bottom
- start
- end
- margin 支持设置一个值和四个值两种格式,如果设置4个值,格式为 左/上/右/下 // from 1.9.3
- marginLeft
- marginTop
- marginRight
- marginBottom
- marginStart
- marginEnd
- marginHorizontal
- marginVertical
- paddingLeft
- paddingTop
- paddingRight
- paddingBottom
- paddingStart
- paddingEnd
- paddingHorizontal
- paddingVertical
- padding 支持设置一个值和四个值两种格式,如果设置4个值,格式为 左/上/右/下 // from 1.9.3
Flexbox Introduction & performance (in Chinese)
Tutorial 1: Create View Controller with xml layout
Tutorial 2: Create Table Cell with xml layout
Tutorial 3: Embed xml layout into traditional view hierarchy
Tutorial 4: Use custom view in xml layout
Tutorial 5: Create reusable view using xml layout file