当前位置:网站首页>Constraintlayout's constraintset dynamically modifies constraints
Constraintlayout's constraintset dynamically modifies constraints
2022-07-03 08:21:00 【cuncaojin】
Use
establish ConstraintSet object
ConstraintSet set = new ConstraintSet(); set.clone(constraintLayout); // or // set.clone(this, R.layout.main_activity);
Constraint element
set.connect(v1.getId(), ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM); set.connect(v2.getId(), ConstraintSet.TOP, v1.getId(), ConstraintSet.BOTTOM, dp2px(16)); set.applyTo(constraintLayout);
Be careful : If there is View Hide Show operation , Be sure to display the operation
View.setVisibility(View.VISIBLE) Not in 1、2 Execute in the middle of step
, Because when establishing constraints , The previous position constraints may be changed , Thus, it shows that it may fail .
Official documents
边栏推荐
- Encoding and decoding of golang URL
- Use filechannel to copy files
- Transplantation of tslib Library
- GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库
- [K & R] Chinese Second Edition personal questions Chapter1
- Open the influence list of "National Meteorological Short Videos (Kwai, Tiktok) in November" in an interactive way“
- My touch screen production "brief history" 1
- IP production stream is so close to me
- Clion toolchains are not configured configure disable profile problem solving
- Some understandings of 3dfiles
猜你喜欢
[updating] wechat applet learning notes_ three
Creation of osgearth earth files to the earth ------ osgearth rendering engine series (1)
About Wireshark's unsuccessful installation of npcap
Clion toolchains are not configured configure disable profile problem solving
十六进制编码简介
Unity change default editor
Wpf: solve the problem that materialdesign:dialoghost cannot be closed
Data analysis exercises
Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
ArrayList
随机推荐
Unity change default editor
php-fpm软件的安装+openresty高速缓存搭建
One dimensional array two dimensional array (sort Max insert sort)
JSON与Object之间转换
Pulitzer Prize in the field of information graphics - malofiej Award
Golang的range
P2622 关灯问题II(状态压缩 搜索)
Mxone Pro adaptive 2.0 film and television template watermelon video theme apple cmsv10 template
C course design employee information management system
redis集群系列四
Transplantation of freetype Library
Abstract classes and interfaces
Maxcompute string splitting function -split_ PART
Lua hot update basic grammar
matlab神经网络所有传递函数(激活函数)公式详解
Mysql容器化(1)Docker安装MySQL
[K & R] Chinese Second Edition personal questions Chapter1
Basic operation and process control
Storage of data
Golang url的编码和解码