object.placeholder

类型 字符串
对象 TextBox
native.*
修订 版本 2024.3703
关键词 原生文本输入
另请参阅 native.newTextBox()

概述

原生文本框可以显示可选的占位符文本(默认为`nil`)。这可以提供用户应该在框中输入内容的“提示”。如果设置,占位符字符串将使用相同的样式信息显示(文本颜色除外)。一旦实际文本输入到框中,占位符就不会出现,并且它目前不参与确定文本框的大小。

示例

local textBox = native.newTextBox( 160, 240, 280, 140 )

-- Optional placeholder (hint) for the text box
textBox.placeholder = "(description)"