Latest 0.1.2
Homepage https://github.com/CodeGeekXu/CGSegmentBar
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

CGSegmentBar

A view like UISegmentedControl,you can customize your style.

Installation

CGSegmentBar is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'CGSegmentBar'

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

CGSegmentBar *dynamicSegmentBar = [[CGSegmentBar alloc]initWithFrame:CGRectMake(0, 100, CGRectGetWidth(self.view.bounds), 40)];
dynamicSegmentBar.titles = @[@"America",@"China",@"Japan",@"Germany",@"France",@"Italy",@"Spain",@"India"];
dynamicSegmentBar.widthStyle = CGSegmentBarWidthStyleDynamic;
dynamicSegmentBar.interitemSpacing = 30;
dynamicSegmentBar.paddingInsets = UIEdgeInsetsMake(0, 10, 0, 10);
dynamicSegmentBar.indicatorHeight = 2;
dynamicSegmentBar.indicatorColor = [UIColor blueColor];
[dynamicSegmentBar reload];
dynamicSegmentBar.didSelectItemBlock = ^(NSUInteger index) {

};
[self.view addSubview:dynamicSegmentBar];

[dynamicSegmentBar setSelectedIndex:2 animated:YES];

Author

CodeGeekXu, [email protected]

License

CGSegmentBar is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CGSegmentBar",
    "version": "0.1.2",
    "summary": "CGSegmentBar",
    "description": "CGSegmentBar is a segment view",
    "homepage": "https://github.com/CodeGeekXu/CGSegmentBar",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "CodeGeekXu": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CodeGeekXu/CGSegmentBar.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "CGSegmentBar/Classes/**/*"
}

Pin It on Pinterest

Share This