美文网首页
SPMultipleSwitch

SPMultipleSwitch

作者: S型身材的猪 | 来源:发表于2018-12-29 16:06 被阅读65次

    Demo地址:https://github.com/SPStore/SPMultipleSwitch

    未命名.gif

    CocoaPods

    pod "SPMultipleSwitch", "~> 1.0"

    Use

    SPMultipleSwitch *multipleSwitch = [[SPMultipleSwitch alloc] initWithItems:@[@"Feed",@"Leaderboard"]];
    multipleSwitch.frame = CGRectMake(30, 100, ScreenW-60, 40);
    multipleSwitch.backgroundColor = [UIColor orangeColor];
    multipleSwitch.selectedTitleColor = [UIColor orangeColor];
    multipleSwitch.titleColor = [UIColor whiteColor];
    multipleSwitch.trackerColor = [UIColor whiteColor];
    multipleSwitch.contentInset = 5;
    multipleSwitch.spacing = 10;
    multipleSwitch.titleFont = [UIFont boldSystemFontOfSize:17];
    multipleSwitch.trackerColor = [UIColor whiteColor];
    [multipleSwitch addTarget:self action:@selector(multipleSwitchAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:multipleSwitch];
    

    OC版本:SPMultipleSwitch
    swift版本:DGRunkeeperSwitch

    相关文章

      网友评论

          本文标题:SPMultipleSwitch

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