Skip to content

UISwitch

开关控件。通过 new UISwitch()new UISwitch(frame) 创建。用 addTargetActionForControlEvents(self, 'switchAction:', 1<<12) 监听值变化(1<<12 为 ValueChanged)。

属性类型说明
onboolean是否开启。
  • UIControl(同属 Control,绑定方式类似)