当前位置:网站首页>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");
边栏推荐
- Difference and the difference between array and array structure and linked list
- 3--新唐nuc980 kernel支持jffs2, Jffs2文件系统制作, 内核挂载jffs2, uboot网口设置,uboot支持tftp
- MySQL
- [unity notes] screen coordinates to ugui coordinates
- Web3对法律的需求
- 本周 火火火火 的开源项目!
- 进程管理基础
- C#/VB.NET 删除Word文檔中的水印
- Common fitting models and application methods of PCL
- PCL 常用拟合模型及使用方法
猜你喜欢
Lumion 11.0软件安装包下载及安装教程
数字滚动增加效果
Google Earth Engine(GEE)——Landsat 全球土地调查 1975年数据集
Integerset of PostgreSQL
Station B's June ranking list - feigua data up main growth ranking list (BiliBili platform) is released!
Web3对法律的需求
1个月增长900w+播放!总结B站顶流恰饭的2个新趋势
#夏日挑战赛#数据库学霸笔记(下)~
unity中跟随鼠标浮动的面板,并可以自适应文字内容的大小
unity 自定义webgl打包模板
随机推荐
Compress JS code with terser
Summer Challenge database Xueba notes (Part 2)~
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
How to build a 32core raspberry pie cluster from 0 to 1
fasterxml ToStringSerializerBase报错
【论文阅读|深读】 GraphSAGE:Inductive Representation Learning on Large Graphs
[Mori city] random talk on GIS data (II)
[C # notes] reading and writing of the contents of text files
FLIR blackfly s usb3 industrial camera: how to use counters and timers
Difference and the difference between array and array structure and linked list
Argo workflows source code analysis
KYSL 海康摄像头 8247 h9 isapi测试
你不可不知道的Selenium 8种元素定位方法,简单且实用
Gee upgrade can realize one piece of run tasks
安全巡检的工作
dotConnect for DB2数据提供者
Ali yunyili: how does yunyuansheng solve the problem of reducing costs and improving efficiency?
本周 火火火火 的开源项目!
This week's hot open source project!
安全交付工程师