美文网首页iOS基础iOS之家
UISWitch颜色大小设置

UISWitch颜色大小设置

作者: 未来可期me | 来源:发表于2016-10-11 16:23 被阅读87次
    - (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颜色大小设置

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