当前位置:网站首页>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
边栏推荐
- 杨辉三角形详解
- Ijkplayer code walkthrough player network video data reading process details
- JS convert text to language for playback
- Wechat applet (pull-down refresh data) novice to
- Super model logo online design and production tool
- ADB shell content command debug database
- [JS] array de duplication
- Download and installation of universal player potplayer, live stream m3u8 import
- 二分查找
- Overview of demoplayer program framework design of ijkplayer
猜你喜欢

Wechat applet (get location)

Local file search tool everything

Jetpack - basic use of room

《MATLAB 神经网络43个案例分析》:第10章 离散Hopfield神经网络的分类——高校科研能力评价

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

Echart line chart: different colors are displayed when the names of multiple line charts are the same

JetPack - - - LifeCycle、ViewModel、LiveData
![[DP 01 backpack]](/img/be/1e5295684ead652eebfb72ab0be47a.jpg)
[DP 01 backpack]

【Kernel】驱动编译的两种方式:编译成模块、编译进内核(使用杂项设备驱动模板)

Detailed explanation of PHP distributed transaction principle
随机推荐
【Kernel】驱动编译的两种方式:编译成模块、编译进内核(使用杂项设备驱动模板)
Super model logo online design and production tool
Solution: vscode open file will always overwrite the last opened label
欧姆龙平替国产大货—JY-V640半导体晶元盒读写器
[kernel] two methods of driver compilation: compiling into modules and compiling into the kernel (using miscellaneous device driver templates)
Differences among concurrent, parallel, serial, synchronous and asynchronous
[JS] array de duplication
【sketchup 2021】草图大师中CAD文件的导入与建模(利用cad图纸在草图大师中建立立面模型)、草图大师导出成品为dwg格式的二维、三维、立面效果到cad中打开预览】
Kotlin basic objects, classes and interfaces
IOError(Errors.E050.format(name=name))
[one · data 𞓜 simple implementation of the leading two-way circular linked list]
MFS详解(七)——MFS客户端与web监控安装配置
Wechat applet custom tabbar (session customer service) vant
High burst solution 2
Recommend a capacity expansion tool to completely solve the problem of insufficient disk space in Disk C and other disks
电镀挂具RFID工序管理解决方案
Not in the following list of legal domain names, wechat applet solution
The boys x pubgmobile linkage is coming! Check out the latest game posters
SSM integration
Analysis of synchronized