ZJSwitch 介绍
ZJSwitch 实现具有 iOS7 风格 UISwitch 控件,可在Switch上显示定制文字。
使用方法:
ZJSwitch *switch0 = [[ZJSwitch alloc] initWithFrame:CGRectMake(100, 100, 60, 31)]; switch0.backgroundColor = [UIColor clearColor]; [switch0 addTarget:self action:@selector(handleSwitchEvent:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:switch0]; ZJSwitch *switch1 = [[ZJSwitch alloc] initWithFrame:CGRectMake(100, 140, 60, 31)]; switch1.backgroundColor = [UIColor clearColor]; switch1.tintColor = [UIColor orangeColor]; [switch1 addTarget:self action:@selector(handleSwitchEvent:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:switch1]; ZJSwitch *switch2 = [[ZJSwitch alloc] initWithFrame:CGRectMake(100, 180, 80, 31)]; switch2.backgroundColor = [UIColor clearColor]; switch2.tintColor = [UIColor orangeColor]; switch2.onText = @"ON"; switch2.offText = @"OFF"; [switch2 addTarget:self action:@selector(handleSwitchEvent:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview:switch2];
ZJSwitch 官网
https://github.com/Jameszjhe/zjswitch
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。