您现在的位置是:主页 > news > 莆田网站开发公司/国家高新技术企业查询

莆田网站开发公司/国家高新技术企业查询

admin2025/5/1 8:10:28news

简介莆田网站开发公司,国家高新技术企业查询,淄博网站制作服务优化,官网的网站建设公司ugui Input Field,获取输入的字符串。 错误方法: string contentinputField.FindChild("Text").text; 这样得到的是输入框中当前盛下的字符串,如果输入框面积小于输入内容,则此时得到的只是输入内容中的一段。 正确方法…

莆田网站开发公司,国家高新技术企业查询,淄博网站制作服务优化,官网的网站建设公司ugui Input Field,获取输入的字符串。 错误方法: string contentinputField.FindChild("Text").text; 这样得到的是输入框中当前盛下的字符串,如果输入框面积小于输入内容,则此时得到的只是输入内容中的一段。 正确方法…


ugui Input Field,获取输入的字符串。

错误方法:

string content=inputField.FindChild("Text").text;

这样得到的是输入框中当前盛下的字符串,如果输入框面积小于输入内容,则此时得到的只是输入内容中的一段。

正确方法:

string content=inputField.getComponent<InputField>().text

这样得到的才是完整的输入内容。

说明见unity文档:

  • To obtains the text of the Input Field, use the text property on the InputField component itself, not the text property of the Text component that displays the text. The text property of the Text component may be cropped or may consist of asterisks for passwords.

转载于:https://www.cnblogs.com/wantnon/p/6020172.html