当前位置:网站首页>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");
边栏推荐
- Alibaba cloud middleware open source past
- 一文读懂Faster RCNN
- 数字滚动增加效果
- CSDN 夏令营课程 项目分析
- Infrared camera: juge infrared mag32 product introduction
- fiddler的使用
- Google Earth Engine(GEE)——Landsat 全球土地调查 1975年数据集
- Web3的先锋兵:虚拟人
- MFC Windows 程序设计[147]之ODBC数据库连接(附源码)
- Lumion 11.0 software installation package download and installation tutorial
猜你喜欢
Compress JS code with terser
MATLB|具有储能的经济调度及机会约束和鲁棒优化
数论 --- 快速幂、快速幂求逆元
postgresql之整体查询大致过程
leetcode:5. Longest palindrome substring [DP + holding the tail of timeout]
Ali yunyili: how does yunyuansheng solve the problem of reducing costs and improving efficiency?
unity中跟随鼠标浮动的面板,并可以自适应文字内容的大小
This week's hot open source project!
软件测试——Jmeter接口测试之常用断言
Apifox,你的API接口文档卷成这样了吗?
随机推荐
阿里云易立:云原生如何破解企业降本提效难题?
B站6月榜单丨飞瓜数据UP主成长排行榜(哔哩哔哩平台)发布!
如何设计好接口测试用例?教你几个小技巧,轻松稿定
数论 --- 快速幂、快速幂求逆元
Ali yunyili: how does yunyuansheng solve the problem of reducing costs and improving efficiency?
服装企业部署MES管理系统的五个原因
Safety delivery engineer
Stm32f4 --- PWM output
dotConnect for DB2数据提供者
C#/VB.NET 删除Word文檔中的水印
[unity] upgraded version · Excel data analysis, automatically create corresponding C classes, automatically create scriptableobject generation classes, and automatically serialize asset files
[C # notes] reading and writing of the contents of text files
Increase 900w+ playback in 1 month! Summarize 2 new trends of top flow qiafan in station B
STM32 project -- Topic sharing (part)
你不可不知道的Selenium 8种元素定位方法,简单且实用
leetcode:736. Lisp 语法解析【花里胡哨 + 栈 + 状态enumaotu + slots】
unity webgl自适应网页尺寸
导数、偏导数、方向导数
MES管理系统的应用和好处有哪些
Metaforce force meta universe development and construction - fossage 2.0 system development