当前位置:网站首页>ConstraintLayout 的使用
ConstraintLayout 的使用
2022-07-03 14:15:00 【菜鸟xiaowang】
1.定位位置
控件的那一边和 另一个控件的那一边对齐
- layout_constraintLeft_toLeftOf 左边和左边对齐
- layout_constraintLeft_toRightOf 左边和右边对齐
- layout_constraintRight_toLeftOf 右边和左边对齐
- layout_constraintRight_toRightOf
- layout_constraintTop_toTopOf
- layout_constraintTop_toBottomOf
- layout_constraintBottom_toTopOf
- layout_constraintBottom_toBottomOf
- layout_constraintBaseline_toBaselineOf
- layout_constraintStart_toEndOf
- layout_constraintStart_toStartOf
- layout_constraintEnd_toStartOf
- layout_constraintEnd_toEndOf

2.居中对齐
同时设置:
水平居中:
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent"
竖直居中:
app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"
偏移
- layout_constraintHorizontal_bias 左右偏移 取值范围 0~1
- layout_constraintVertical_bias 上下偏移 取值范围 0~1
3.margin的设置
同时使用
android:layout_marginXXX="30dp" app:layout_constraintXXX_toBottomOf="@+id/insert"
边栏推荐
- Preliminary summary of structure
- Sendmail无法发送邮件及发送过慢解决
- C language,%d% Difference between 2D%2d%02d
- Sendmail can't send mail and it's too slow to send. Solve it
- Toast UI editor (editor allows you to edit your markup document using text or WYSIWYG, with syntax highlighting, scrolling synchronization, real-time preview and chart functions.)
- C library function - qsort()
- Selective sorting
- String substitution
- JS get DPI, PX to cm, cm to PX
- Exercise 10-3 recursive implementation of exponential functions
猜你喜欢

Exercise 8-8 moving letters

Jiuyi cloud black free encryption free version source code

愉悦资本新双币基金近40亿元完成首次关账

7-10 calculate salary

concat和concat_ws()区别及group_concat()和repeat()函数的使用

玖逸云黑免费无加密版本源码

牛客网:过河卒

Programmable logic device software testing

TS code automatically generates JS

Exercise 10-8 recursive implementation of sequential output of integers
随机推荐
7-22 tortoise and rabbit race (result oriented)
7-11 calculation of residential water charges by sections
Preliminary summary of structure
Exercise 9-3 plane vector addition
JVM garbage collector
fpga阻塞赋值和非阻塞赋值
一文了解微分段应用场景与实现机制
7-9 find a small ball with a balance
超简单手机地图开发
7-4 BCD decryption (10 points)
Accelerating strategy learning using parallel differentiable simulation
Convert string to decimal integer
Interface for querying IP home
牛客网:过河卒
Too many files with unapproved license
Current situation, analysis and prediction of information and innovation industry
Exercise 10-8 recursive implementation of sequential output of integers
JVM垃圾回收机
7-17 crawling worms (break exercise)
JS input number and standard digit number are compared. The problem of adding 0 to 0