美文网首页
UISwitch-自定义状态

UISwitch-自定义状态

作者: 似奔跑的野马 | 来源:发表于2017-06-01 12:03 被阅读0次

OS 系统开关控件简单使用总结:

初始化:

- (instancetype)initWithFrame:(CGRect)frame;

这个frame是没有意义的,系统的开关控件大小是确定的。

设置开关开启状态时的颜色

@property(nonatomic, retain) UIColor *onTintColor;

设置开关风格颜色

@property(nonatomic, retain) UIColor *tintColor;

设置开关按钮颜色

@property(nonatomic, retain) UIColor *thumbTintColor;

设置开关开启状态时的图片(注意:在IOS7后不再起任何作用,In iOS 7, this property has no effect.)

@property(nonatomic, retain) UIImage *onImage;

设置开关关闭状态时的图片(注意:在IOS7后不再起任何作用,In iOS 7, this property has no effect.)

@property(nonatomic, retain) UIImage *offImage;

开关的状态

@property(nonatomic,getter=isOn) BOOL on;

手动设置开关状态

- (void)setOn:(BOOL)on animated:(BOOL)animated;

相关文章

网友评论

      本文标题:UISwitch-自定义状态

      本文链接:https://www.haomeiwen.com/subject/nvosfxtx.html