当前位置:网站首页>Code line breaking problem of untiy text box
Code line breaking problem of untiy text box
2022-07-07 02:35:00 【Wu Zimu】
If we take the initiative to specify line breaks , We can use \n To wrap
for example
infoText.text = "id:" + monitor.id + "\n" +
"cameraType:" + monitor.cameraType + "\n" +
"workshopName:" + monitor.workshopName+ "\n" +
"camerasIP:" + monitor.camerasIp + "\n" +
"camerasUser:" + monitor.camerasUser + "\n" +
"camerasPwd:" + monitor.camerasPwd + "\n" +
"camerasPort:" + monitor.camerasPort + "\n" +
"monitorName:" + monitor.monitorName+"\n"+
"region:"+monitor.region+"\n"+
"code:"+monitor.code
If the text comes from elsewhere , Like downloading from a server , If the text comes with \n Line break , Put the text directly into text in ,\n Will be recognized as characters , Without breaking lines , This is because Untiy It's very kind to help us automatically \n Replace with \n 了 ( Although you are sure that the data you get is \n), So we need to manually \n Replace with \n, Prevent being escaped
for example
BookRequestResult bookResult = JsonConvert.DeserializeObject<BookRequestResult>(request.downloadHandler.text);
contentText.text = bookResult.data.book;
contentText.text = contentText.text.Replace("\\n","\n");
contentText.text = contentText.text.Replace("\\r","\r");
边栏推荐
- 3D laser slam: time synchronization of livox lidar hardware
- AWS学习笔记(一)
- Lumion 11.0 software installation package download and installation tutorial
- Lombok同时使⽤@Data和@Builder 的坑
- 测试优惠券要怎么写测试用例?
- 【Node学习笔记】chokidar模块实现文件监听
- unity webgl自适应网页尺寸
- leetcode:736. LISP syntax parsing [flowery + stack + status enumaotu + slots]
- 1--新唐nuc980 NUC980移植 UBOOT,从外部mx25l启动
- 写作系列之contribution
猜你喜欢

软件测试——Jmeter接口测试之常用断言

用全连接+softmax对图片的feature进行分类

Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module

Overall query process of PostgreSQL

C语言练习题_1
![[paper reading | deep reading] anrl: attributed network representation learning via deep neural networks](/img/06/17acf9958228cce5d80ada3275ad24.png)
[paper reading | deep reading] anrl: attributed network representation learning via deep neural networks

Summer Challenge database Xueba notes (Part 2)~

The last line of defense of cloud primary mixing department: node waterline design
![[server data recovery] data recovery case of a Dell server crash caused by raid damage](/img/29/e07bf1f8eae9be19f6eed69be5642d.jpg)
[server data recovery] data recovery case of a Dell server crash caused by raid damage

运维管理系统有哪些特色
随机推荐
运维管理系统有哪些特色
Draco - glTF模型压缩利器
Lombok makes the pit of ⽤ @data and @builder at the same time
A new path for enterprise mid Platform Construction -- low code platform
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
pgpool-II和pgpoolAdmin的使用
How do I dump SoapClient requests for debugging- How to dump SoapClient request for debug?
遇到慢SQL该怎么办?(下)
[unity notes] screen coordinates to ugui coordinates
Application analysis of face recognition
The boss is quarantined
QPushButton-》函数精解
Recommended collection!! Which is the best flutter status management plug-in? Please look at the ranking list of yard farmers on the island!
[Mori city] random talk on GIS data (II)
Chang'an chain learning notes - certificate model of certificate research
Use of fiddler
Gee upgrade can realize one piece of run tasks
Leetcode:minimum_ depth_ of_ binary_ Tree solutions
Leetcode:minimum_depth_of_binary_tree解决问题的方法
软件测试——Jmeter接口测试之常用断言