当前位置:网站首页>Subtotal of constraintlayout
Subtotal of constraintlayout
2022-06-13 06:34:00 【Sindyue】
ConstraintLayout You can reduce the nesting of layouts , The aspect ratio can also be fixed , To a certain extent, it meets the needs of the project , There are a few easily forgotten points , recorded .
1. Fixed aspect ratio
constraintDimensionRatio To make ( Such as :app:layout_constraintDimensionRatio=”1:3” Indicates that the aspect ratio is 1:3) The following conditions are required for this attribute to take effect :
1)left ,right ,top ,bottom All four edges need constraints ,bottom The constraint of can be used baseline Instead of .
2) At least one of the width and height is 0dp perhaps -1dp, If it's all 0dp Will be displayed in the maximum range of the parent layout .
2.GuideLine Use
Guideline yes ConstraintLayout Of Guideline Utility classes for helper objects , The helper does not appear on the device , It is defaulted to View.GONE, And it cannot be changed . in addition ,Guideline It's for ConstraintLayout Created , That is, it can only be used for ConstraintLayou Layout .
<android.support.constraint.Guideline
android:id="@+id/guide_line_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
The above is an example of a split line in the middle of a horizontal direction , Here are some instructions :
vertical Guideline The width is 0, The height is ConstraintLayout Height
level Guideline The width is ConstraintLayout Width , The height is 0
GuideLine It can also be thought of as a view , It can be based on the dp Or percentage , take GuideLine Position in layout , There are three ways to determine the position :
layout_constraintGuide_begin: Specify a fixed distance from the left or top of the layout (dp)
layout_constraintGuide_end: Specify a fixed distance from the right or bottom of the layout (dp)
layout_constraintGuide_percent: Specify a percentage of the width or height of the layout
边栏推荐
- Echart line chart: when multiple lines have the same name, the legend is still displayed
- 347. top k high frequency elements heap sort + bucket sort +map
- [2022 college entrance examination season] what I want to say as a passer-by
- Wechat applet (function transfer parameters, transfer multiple parameters, page Jump)
- MFS详解(六)——MFS Chunk Server服务器安装与配置
- RFID process management solution for electroplating fixture
- ADB shell CMD overlay debugging command facilitates viewing system framework character resource values
- Dragon Boat Festival wellbeing, use blessing words to generate word cloud
- The boys x pubgmobile linkage is coming! Check out the latest game posters
- [var const let differences]
猜你喜欢

MFS详解(七)——MFS客户端与web监控安装配置

二分查找

SSM integration

AI realizes "Resurrection" of relatives | old photo repair | old photo coloring, recommended by free app

Jetpack - basic use of room

‘ipconfig‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

Echart histogram: X-axis displays value, Y-axis displays category

MFS详解(六)——MFS Chunk Server服务器安装与配置
![[solution] camunda deployment process should point to a running platform rest API](/img/ef/5b893e9c315c10db6c1db46b4c3f5a.jpg)
[solution] camunda deployment process should point to a running platform rest API

Kotlin collaboration -- context and exception handling
随机推荐
The processing and application of C language to documents
Solution: vscode open file will always overwrite the last opened label
Analysis of 43 cases of MATLAB neural network: Chapter 10 classification of discrete Hopfield Neural Network -- evaluation of scientific research ability of colleges and Universities
MFS details (VII) -- MFS client and web monitoring installation configuration
Kotlin collaboration - simple use of collaboration
Local file search tool everything
MFS详解(六)——MFS Chunk Server服务器安装与配置
动态链接库嵌套样例
App performance test: (I) startup time
MFS explanation (VI) -- MFS chunk server installation and configuration
JetPack - - - DataBinding
ADB shell sendent debug input event
[2022 college entrance examination season] what I want to say as a passer-by
Waterfall flow layout of uni app Homepage
Download and installation of universal player potplayer, live stream m3u8 import
[solution] camunda deployment process should point to a running platform rest API
JetPack - - -WorkManger
Echart line chart: different colors are displayed when the names of multiple line charts are the same
After clicking the uniapp e-commerce H5 embedded applet, the page prompts "the page iframe does not support referencing non business domain names"
Dynamic link library nesting example