RadioGroup():hasDefaultValue()
检查创建组时是否提供了默认按钮。
签名
hasDefaultValue(): boolean
返回值
boolean - 如果向 RadioGroup(id, defaultButtonId) 传入了默认按钮 id,则为 true。
示例
local group = RadioGroup(5, 2)
group:add(RadioButton(1, "Small"))
group:add(RadioButton(2, "Large"))
if group:hasDefaultValue() then
toast("Default: " .. group:getDefaultButtonId())
end