跳到主要内容

默认文本约束 (Selector.hint_text)

Selector.hint_text

声明

node.selector():hint_text(val)

参数

参数类型是否必填说明
valstring控件的默认文本,支持正则表达式

返回值

类型说明
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()