当前位置:网站首页>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


边栏推荐
- 超限黑客认知
- Golang中删除字符串的最后一个字符
- Data analysis exercises
- Golang json格式和结构体相互转换
- CLion-Toolchains are not configured Configure Disable profile问题解决
- Viz artist advanced script video tutorial -- stringmap use and vertex operation
- Golang 字符串分割,替换和截取
- 一条通往服务器所有端口的隧道
- Detailed explanation of all transfer function (activation function) formulas of MATLAB neural network
- Haproxy+kept build 01
猜你喜欢

Open the influence list of "National Meteorological Short Videos (Kwai, Tiktok) in November" in an interactive way“

About Wireshark's unsuccessful installation of npcap

Image processing 8-cnn image classification

IP production stream is so close to me

Use of ue5 QRcode plug-in

方正锐利重磅升级到12.0版本,包装印前处理更加便捷、高效!

图像处理8-CNN图像分类
![P1596 [USACO10OCT]Lake Counting S](/img/a7/07a84c93ee476788d9443c0add808b.png)
P1596 [USACO10OCT]Lake Counting S

Kunlunbase meetup is waiting for you!

My touch screen production "brief history" 1
随机推荐
Scite change background color
php-fpm软件的安装+openresty高速缓存搭建
Clion toolchains are not configured configure disable profile problem solving
[set theory] order relation (hastu example | divisive relation hastu | inclusive relation hastu | refinement relation hastu)
Storage of data
A tunnel to all ports of the server
Conversion between golang JSON format and structure
Viz artist advanced script video tutorial -- stringmap use and vertex operation
jupyter远程服务器配置以及服务器开机自启
YOLO系列 --- xml2txt脚本
十六进制编码简介
LinkList
Zohocrm deluge function application time verification
Golang url的编码和解码
Delete the last character of the string in golang
Classes and objects
Basic operation and process control
Data analysis exercises
[updating] wechat applet learning notes_ three
What does (+) in Oracle mean