当前位置:网站首页>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");
边栏推荐
- [paper reading | deep reading] graphsage:inductive representation learning on large graphs
- Draco - gltf model compression tool
- 电气工程及其自动化
- 纽约大学 CITIES 研究中心招聘理学硕士和博士后
- 阿里云易立:云原生如何破解企业降本提效难题?
- C语言练习题_1
- 安德鲁斯—-多媒体编程
- MFC Windows 程序设计[147]之ODBC数据库连接(附源码)
- S120驱动器基本调试步骤总结
- How to build a 32core raspberry pie cluster from 0 to 1
猜你喜欢
[paper reading | deep reading] anrl: attributed network representation learning via deep neural networks
[Mori city] random talk on GIS data (II)
Data connection mode in low code platform (Part 1)
Lumion 11.0 software installation package download and installation tutorial
How to build a 32core raspberry pie cluster from 0 to 1
压缩 js 代码就用 terser
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
[server data recovery] data recovery case of a Dell server crash caused by raid damage
MySQL --- 常用函数 - 字符串函数
C#/VB. Net to delete watermarks in word documents
随机推荐
fiddler的使用
[unity notes] screen coordinates to ugui coordinates
#夏日挑战赛#数据库学霸笔记(下)~
1个月增长900w+播放!总结B站顶流恰饭的2个新趋势
B站6月榜单丨飞瓜数据UP主成长排行榜(哔哩哔哩平台)发布!
【软件测试】最全面试问题和回答,全文背熟不拿下offer算我输
Go swagger use
1--新唐nuc980 NUC980移植 UBOOT,从外部mx25l启动
PostgreSQL图形化界面工具之pgAdmin4
Fundamentals of process management
Station B's June ranking list - feigua data up main growth ranking list (BiliBili platform) is released!
CSDN summer camp course project analysis
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
fasterxml ToStringSerializerBase报错
Draco - gltf model compression tool
The cities research center of New York University recruits master of science and postdoctoral students
STM32 project -- Topic sharing (part)
postgresql之整体查询大致过程
A new path for enterprise mid Platform Construction -- low code platform
记一次JAP查询导致OOM的问题分析