默认文本约束 (Selector.hint_text)
Selector.hint_text
声明
node.selector():hint_text(val)
参数
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| val | string | 是 | 控件的默认文本,支持正则表达式 |
返回值
| 类型 | 说明 |
|---|---|
| Selector | 返回控件查找器,用于链式编程 |
说明
通过控件默认文本(placeholder)约束。
待实现
该接口正在开发中。
示例
local node = require("node")
-- 查找默认文本包含 "小程序" 的控件
local n = node.selector():hint_text(".*小程序.*"):find()
if n then
print(node)
else
print("没有找到任何控件")
end
AScript 对应
# AScript (Python)
from ascript.android.node import Selector
node = Selector().hintText(".*小程序.*").find()