当前位置:网站首页>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");
边栏推荐
- AWS学习笔记(一)
- unity中跟随鼠标浮动的面板,并可以自适应文字内容的大小
- 企业中台建设新路径——低代码平台
- 一文读懂Faster RCNN
- [C # notes] reading and writing of the contents of text files
- 数论 --- 快速幂、快速幂求逆元
- 豆瓣平均 9.x,分布式领域的 5 本神书!
- 3D laser slam: time synchronization of livox lidar hardware
- Linear list --- circular linked list
- Halcon instance to opencvsharp (C openCV) implementation -- bottle mouth defect detection (with source code)
猜你喜欢
![leetcode:736. LISP syntax parsing [flowery + stack + status enumaotu + slots]](/img/0d/e07fe970167368040eb09b05c3682e.png)
leetcode:736. LISP syntax parsing [flowery + stack + status enumaotu + slots]

C # / vb. Net supprime le filigrane d'un document word

服装企业部署MES管理系统的五个原因

This week's hot open source project!
![[unity] upgraded version · Excel data analysis, automatically create corresponding C classes, automatically create scriptableobject generation classes, and automatically serialize asset files](/img/20/f7fc2204ca165dcea4af25cb054e9b.png)
[unity] upgraded version · Excel data analysis, automatically create corresponding C classes, automatically create scriptableobject generation classes, and automatically serialize asset files

unity中跟随鼠标浮动的面板,并可以自适应文字内容的大小

记一次JAP查询导致OOM的问题分析

测试优惠券要怎么写测试用例?

6-6 vulnerability exploitation SSH security defense

Stm32f4 --- PWM output
随机推荐
Work of safety inspection
数论 --- 快速幂、快速幂求逆元
[C # notes] use file stream to copy files
4 -- Xintang nuc980 mount initramfs NFS file system
Halcon instance to opencvsharp (C openCV) implementation -- bottle mouth defect detection (with source code)
The cities research center of New York University recruits master of science and postdoctoral students
写作系列之contribution
STM32项目 -- 选题分享(部分)
Increase 900w+ playback in 1 month! Summarize 2 new trends of top flow qiafan in station B
Leetcode:minimum_depth_of_binary_tree解决问题的方法
Metaforce force meta universe development and construction - fossage 2.0 system development
【森城市】GIS数据漫谈(二)
C语言练习题_1
Google Earth Engine(GEE)——Landsat 全球土地调查 1975年数据集
软件测试——Jmeter接口测试之常用断言
ODBC database connection of MFC windows programming [147] (with source code)
Ali yunyili: how does yunyuansheng solve the problem of reducing costs and improving efficiency?
C#/VB.NET 删除Word文檔中的水印
Overall query process of PostgreSQL
leetcode:736. LISP syntax parsing [flowery + stack + status enumaotu + slots]