当前位置:网站首页>untiy强制刷新UI
untiy强制刷新UI
2022-06-25 12:51:00 【吴梓穆】
在向一个自适应内容长度的text里添加文字,并把text放进滚动窗口里,发现虽然text的尺寸自适应扩充了,但是在scroll view里却没有显示第一行,而且是显示了中间,这时随便修改一个scroll view的属性,text都会弹回第一行,这说明创建scroll view时,没有刷新text,导致scroll view认为text还是扩充前的尺寸,这时候我们只要强制刷新一下UI即可
LayoutRebuilder.ForceRebuildLayoutImmediate(contentText.rectTransform);
这是一个静态方法,参数是被刷新UI的rectTransform
边栏推荐
- Shenzhen mintai'an intelligent second side_ The first offer of autumn recruitment
- The starting point for learning programming.
- 初始c语言的知识2.0
- 一篇文章讲清楚MySQL的聚簇/联合/覆盖索引、回表、索引下推
- Golang keyboard input statement scanln scanf code example
- Used in time filter (EL table)
- 關於數據在內存中的存儲下
- QT display ffmpeg decoded pictures
- Summary of leetcode linked list problem solving skills
- Scope of ES6 variable
猜你喜欢
Implementation of a small book system
leetcode:918. 环形子数组的最大和【逆向思维 + 最大子数组和】
[machine learning] parameter learning and gradient descent
Golang keyboard input statement scanln scanf code example
Prototype and prototype chain - constructor and instanceof
字符串各操作函数与内存函数详解
指针,它那些不得不说的题目
OpenStack学习笔记(一)
解析数仓lazyagg查询重写优化
Sword finger offer II 029 Sorted circular linked list
随机推荐
golang键盘输入语句scanln scanf代码示例
Serenvlt first met
Shenzhen mintai'an intelligent second side_ The first offer of autumn recruitment
Sword finger offer day 1 stack and queue (simple)
Pointer, it has to say that the subject
Analyse de l'optimisation de la réécriture des requêtes lazyagg de l'entrepôt
Sword finger offer II 028 Flatten multi-level bidirectional linked list
Sword finger offer II 025 Adding two numbers in a linked list
Germany holds global food security Solidarity Conference
Win7显示屏幕亮度在哪里可以调节
Implementation of a small book system
On the realization of guessing numbers game
How unity makes the UI intercept click events
Sword finger offer day 3 string (simple)
Explication d'un problème de manuel
Nova中的api
API in Nova
Openstack learning notes (II)
Used in time filter (EL table)
關於數據在內存中的存儲下