当前位置:网站首页>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"
边栏推荐
- JS get DPI, PX to cm, cm to PX
- Programming language: the essence of type system
- JVM garbage collector
- JS Part III
- Solution to failure or slow downloading of electron when electron uses electron builder to package
- Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
- allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
- 7-28 monkeys choose King (Joseph problem)
- 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.)
- Vite project commissioning
猜你喜欢

556. 下一个更大元素 III

Jiuyi cloud black free encryption free version source code

Exercise 9-3 plane vector addition

八大排序

Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?

Programmable logic device software testing

Fabric. JS document

x86汇编语言-从实模式到保护模式 笔记

JS input number and standard digit number are compared. The problem of adding 0 to 0

Doris学习笔记之数据表的创建
随机推荐
编程语言:类型系统的本质
7-17 crawling worms (break exercise)
Stop asking yourself if you are suitable for software testing
超简单手机地图开发
JVM runtime data area
Common mixins
PCB中常用快捷键
别再问自己适不适合做软件测试了
TS code automatically generates JS
MySQL multi table query subquery
Common plug-ins for vite project development
Too many files with unapproved license
Similarities and differences between Allegro, OrCAD, net alias, port, off page connector and how to select them
7-15 calculation of PI
Preliminary summary of structure
7-18 finding the single root of polynomial by dichotomy
Exercise 6-6 use a function to output an integer in reverse order
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.)
Simulated access
常见问题之PHP——ldap_add(): Add: Undefined attribute type in