ConstraintLayout的使用与五分彩源码出售

首先需要引入我们的ConstraintLayout,在build.gradle中加入:五分彩源码出售【企 娥:217 1793 408】

compile ‘com.android.support.constraint:constraint-layout:1.0.2’

常用的属性:

layout_constraintLeft_toLeftOf
layout_constraintLeft_toRightOf
layout_constraintRight_toLeftOf
layout_constraintRight_toRightOf
layout_constraintTop_toTopOf
layout_constraintTop_toBottomOf
layout_constraintBottom_toTopOf
layout_constraintBottom_toBottomOf

即文章的baseline对齐
layout_constraintBaseline_toBaselineOf

与left,right类似
layout_constraintStart_toEndOf
layout_constraintStart_toStartOf
layout_constraintEnd_toStartOf
layout_constraintEnd_toEndOf

margin不需要解释
android:layout_marginStart
android:layout_marginEnd
android:layout_marginLeft
android:layout_marginTop
android:layout_marginRight
android:layout_marginBottom

layout_constraintHorizontal_bias
layout_constraintVertical_bias

layout_constraintHorizontal_chainStyle
layout_constraintVertical_chainStyle

layout_constraintVertical_weight

Guideline

猜你喜欢

转载自blog.51cto.com/13927797/2161179