0

如果我在检查器中设置文本值而不是在代码中设置文本值,它可以工作,水平溢出要么换行(如果溢出设置为 Wrap)或溢出(如果溢出设置为溢出),并且字体大小永远不会缩放以适应不换行也不溢出

水平溢出在代码中设置为溢出,但在检查器中设置为 Wrap 垂直溢出设置为 Truncate Best Fit 已选中,Min Size = 10,Max Size = 40

非常感谢任何帮助

[在下面编辑,添加文本组件的 Inspector 设置的代码和屏幕截图]

dataText.horizontalOverflow = HorizontalWrapMode.Overflow;
dataText.horizontalOverflow = HorizontalWrapMode.Wrap;
dataText.text = " My Blablablablablatext---->>>>>>:\n______________________________________\n";
dataText += ">>>>>>>>and some more text"
dataText.resizeTextForBestFit = false;//Just added this to test, see if reseting would help, it didn't
dataText.resizeTextForBestFit = true;//Just added this to test, see if reseting would help, it didn't

在此处输入图像描述

4

0 回答 0