新控件ConstraintLayout、FlexboxLayout快速使用
来源:互联网 发布:淘宝网健身球服装 编辑:程序博客网 时间:2024/05/16 02:31
ConstraintLayout:
(1)导包
compile ‘com.android.support:appcompat-v7:25.0.1’
类名:
android.support.constraint.ConstraintLayout
(2)属性介绍
一、位置控制
子控件的属性:
(1)8个边界约束属性可以固定View的最左边、最右边、最上面、最下面的位置
app:layout_constraintLeft_toLeftOf
app:layout_constraintLeft_toRightOf //我最左边的位置 在别人的右边 下面的意思类似
app:layout_constraintRight_toRightOf
app:layout_constraintRight_toLeftOf app:layout_constraintTop_toTopOf
app:layout_constraintTop_toBottomOf
app:layout_constraintBottom_toBottomOf
app:layout_constraintBottom_toTopOf
(2)通过设置偏移属性,可以控制View在边界范围移动,最左边是0,最右边是1,中间是0.5:
layout_constraintHorizontal_bias(水平方向偏移)(范围0-1)layout_constraintVertical_bias(垂直方向偏移)(范围0-1)
二、大小控制
layout_constraintHorizontal_weight //水平方向上比重,类似线性布局
layout_constraintVertical_weight //垂直方向上比重,类似线性布局
1.实现水平方向线性布局,所有的View都必须设置左右边界控制属性,而且相互控制
2.实现比重大小控制,必须设置layout_width=”0dp”重点内容
FlexboxLayout
根布局:xmlns:app=”http://schemas.android.com/apk/res-auto”
app:flexDirection=”column”
app:flexWrap=”wrap”
app:justifyContent=”center”
app:alignItems=”flex_start”
app:alignContent=”flex_start”
子元素属性:app:layout_order="3"app:layout_flexGrow="1"app:layout_alignSelf="stretch"app:layout_flexShrink="1"app:layout_alignSelf="baseline"app:layout_flexBasisPercent="80%"
- 新控件ConstraintLayout、FlexboxLayout快速使用
- 快速使用ConstraintLayout
- 【Android 基础】Google新推出的Android布局控件FlexboxLayout
- 新布局节点ConstraintLayout基本使用
- Android新布局ConstraintLayout的使用
- Android最新控件FlexboxLayout
- 【39】FlexboxLayout使用介绍
- android中使用flexboxlayout
- android flexboxlayout简单使用
- Android FlexboxLayout使用体验
- FlexboxLayout的使用
- 详解FlexboxLayout的使用
- Android Flexboxlayout使用详解
- FlexBoxLayout控件做流布局
- 布局新成员:ConstraintLayout
- ConstraintLayout新布局
- Android新特性ConstraintLayout
- ConstraintLayout约束控件详解
- MyEclipse使用总结——Maven项目如何启动运行发布到tomcat中[转]
- phpSimpleHtmlDom采集类库_Jquery筛选方式
- java面试宝典
- 机器学习算法-决策树(一)
- Linux运维工程师将变成最火职业
- 新控件ConstraintLayout、FlexboxLayout快速使用
- 修改UGUI RawImage形状(在一个rawimage上显示N个颜色,两两颜色之间有过度)
- Luogu P1563 [NOIp提高组2016]玩具谜题
- Dell台式机重装系统提示SupportAssist问题
- Linux 上Docker的安装与使用入门
- K-医生看病
- 大型网站架构技能图谱(Java版)
- GCD浅析
- 求一个数组的最长的单调自增子序列(C代码实现)