跳到主要内容

枚举值集合(EnumValues)

方法(Methods)

__len

获取枚举值数量。

local vmi = context:viewModel()
if vmi then
local textAlignment = vmi:getEnum('textAlignment')

if textAlignment then
local values = textAlignment:values()
print('count: ', #values)
end
end