当前位置:网站首页>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"
边栏推荐
- Message subscription and publishing
- 6-9 statistics of single digits (15 points)
- concat和concat_ws()区别及group_concat()和repeat()函数的使用
- JVM garbage collector
- JS first summary
- Zabbix添加Calculated items后保存页面成空白
- TS code automatically generates JS
- Understand the application scenario and implementation mechanism of differential segment
- x86汇编语言-从实模式到保护模式 笔记
- protobuf与grpc
猜你喜欢

Understanding of closures

Eight sorts

Vite project commissioning

7-11 calculation of residential water charges by sections

常见问题之PHP——ldap_add(): Add: Undefined attribute type in

Scroll detection of the navigation bar enables the navigation bar to slide and fix with no content

Exercise 8-8 moving letters

一文了解微分段应用场景与实现机制
![[clean up the extraordinary image of Disk C]](/img/0d/331115bc5d82d6337ae975a08494b2.jpg)
[clean up the extraordinary image of Disk C]

关于回溯问题中的排列问题的思考(LeetCode46题与47题)
随机推荐
protobuf与grpc
7-24 reduction of the simplest fraction (rolling Division)
Message subscription and publishing
npm install卡住与node-npy的各种奇怪报错
FPGA test method takes mentor tool as an example
Programmable logic device software testing
Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
Sendmail无法发送邮件及发送过慢解决
Understand the application scenario and implementation mechanism of differential segment
好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
7-8 overspeed judgment
Webpage connection database ~ simple implementation of addition, deletion, modification and query complete code
Redis:字符串类型数据的操作命令
7-4 BCD decryption (10 points)
Scroll detection, so that the content in the lower right corner is not displayed at the top of the page, but is displayed as the mouse slides
7-15 calculation of PI
7-14 sum integer segments (C language)
Thread.sleep和TimeUnit.SECONDS.sleep的区别
Leetcode (4) -- find the median of two positively ordered arrays