当前位置:网站首页>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"
边栏推荐
- Selective sorting
- Collection of mobile adaptation related articles
- Add ZABBIX calculation type itemcalculated items
- 八大排序
- DDK for XP
- JS download files through URL links
- Back to top implementation
- 7-24 reduction of the simplest fraction (rolling Division)
- SSH access control, blocking the IP when logging in repeatedly to prevent brute force cracking
- 中国锂电池电解液行业市场专项调研报告(2022版)
猜你喜欢
随机推荐
Exercise 9-1 time conversion
JS shift operators (< <,> > and > > >)
GRPC的四种数据流以及案例
Exercise 10-8 recursive implementation of sequential output of integers
MongoDB索引
Collection of mobile adaptation related articles
7-18 finding the single root of polynomial by dichotomy
Jiuyi cloud black free encryption free version source code
Redis:字符串類型數據的操作命令
etcd集群权限管理和账号密码使用
Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
愉悦资本新双币基金近40亿元完成首次关账
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
C library function - qsort()
中感微冲刺科创板:年营收2.4亿净亏1782万 拟募资6亿
556. 下一个更大元素 III
Too many files with unapproved license
Why is this error reported when modifying records in the database
28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
JS get DPI, PX to cm, cm to PX