UISWitch颜色大小设置

- (void)addSwitch {
    UISwitch *switchBtn = [[UISwitch alloc] initWithFrame:CGRectMake(MainScreenWidth-60, 28, 40, 20)];
    switchBtn.transform = CGAffineTransformMakeScale(0.75, 0.75);
    switchBtn.onTintColor = BLUECOLOR;
    switchBtn.tag = 10000;
    [switchBtn addTarget:self action:@selector(subscribeTopic:) forControlEvents:UIControlEventValueChanged];
    [_titleImage addSubview:switchBtn];
}
- (void)subscribeTopic:(UISwitch *)sender {
    NSString *url;
    if (sender.on) {
        url = API_URL_DoFollowTopic;
    }else {
        url = API_URL_UnFollowTopic;
    }

你可能感兴趣的:(UISWitch颜色大小设置)