Latest 0.1.0
Homepage https://github.com/zczczyc/ZCSegmentControl
License MIT
Platforms ios 8.0
Authors

图片

使用说明

pod 'ZCSegmentControl'
- (ZCSegmentedControl *)segmentedControl {

    if (!_segmentedControl) {
        _segmentedControl = [[ZCSegmentedControl alloc] initWithSectionTitles:self.categoryListArray];
        //        _segmentedControl.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth;
        _segmentedControl.frame = CGRectMake(0, kKD_SearchBarHeight+kHTMI_MoreStatusBarHeight + 20, kScreenWidth, 40);
        _segmentedControl.selectedSegmentIndex = 0;
        _segmentedControl.segmentEdgeInset = UIEdgeInsetsMake(0, 10, 0, 10);
        _segmentedControl.selectionStyle = HTMISegmentedControlSelectionStyleFullWidthStripe;
        _segmentedControl.selectionIndicatorLocation = HTMISegmentedControlSelectionIndicatorLocationDown;

        _segmentedControl.selectionIndicatorColor = [UIColor redColor];
        _segmentedControl.titleTextAttributes [email protected]{NSForegroundColorAttributeName : [UIColor blackColor],NSFontAttributeName :[UIFont systemFontOfSize:14]};
        _segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor redColor],NSFontAttributeName :[UIFont systemFontOfSize:14]};

        _segmentedControl.selectionIndicatorHeight = 2.0;
        [_segmentedControl addTarget:self action:@selector(segmentPress:) forControlEvents:UIControlEventValueChanged];
//        _segmentedControl.backgroundColor = RGB(249, 249, 249);
    }
    return _segmentedControl;
}
/**
 *  segment点击事件
 *
 *  @param segment UISegmentedControl
 */
- (void)segmentPress:(ZCSegmentedControl *)segment {

  NSLog(@"%ld",(long)segment.selectedSegmentIndex);
}

Latest podspec

{
    "name": "ZCSegmentControl",
    "version": "0.1.0",
    "summary": "A short description of ZCSegmentControl.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/zczczyc/ZCSegmentControl",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u6731u51b2u51b2": "gitzczyc"
    },
    "source": {
        "git": "https://github.com/zczczyc/ZCSegmentControl.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ZCSegmentControl/Classes/**/*"
}

Pin It on Pinterest

Share This