Latest 1.0.3
Homepage https://github.com/gsyhei/GXSlideSegmentController
License MIT
Platforms ios 7.0, requires ARC
Authors

仿网易新闻侧滑视图

使用方法:

NSMutableArray *vcs = [NSMutableArray array];
for (int i = 0; i < 10; i++) {
    UIViewController *vc = [[UIViewController alloc] init];
    vc.title = [NSString stringWithFormat:@"%d", i];
    vc.view.backgroundColor = [UIColor colorWithRed:((255.0 * (i%2)) / 255) green:((255.0 * ((i+1)%2)) / 255) blue:((255.0 * ((i+2)%2)) / 255) alpha:1];

    UILabel *label = [[UILabel alloc] initWithFrame:vc.view.bounds];
    label.text = [NSString stringWithFormat:@"%d", i];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:100];
    label.textColor = [UIColor purpleColor];
    label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
    [vc.view addSubview:label];

    [vcs addObject:vc];
}

GXSlideSegmentController *slideSegmentController = [[GXSlideSegmentController alloc] initWithViewControllers:vcs];
slideSegmentController.title = @"GXSlideSegmentController";
slideSegmentController.indicatorInsets = UIEdgeInsetsMake(0, 8, 0, 8);
slideSegmentController.indicator.backgroundColor = [UIColor redColor];
slideSegmentController.indicator.layer.cornerRadius = slideSegmentController.indicator.frame.size.height/2;
[self.navigationController pushViewController:slideSegmentController animated:YES];

cocoapods

pod ‘GXSlideSegmentController’

Latest podspec

{
    "name": "GXSlideSegmentController",
    "version": "1.0.3",
    "summary": "u4effu7f51u6613u65b0u95fbu4fa7u6ed1u63a7u5236u5668.",
    "homepage": "https://github.com/gsyhei/GXSlideSegmentController",
    "license": "MIT",
    "authors": {
        "Gin": "[email protected]"
    },
    "social_media_url": "https://github.com/gsyhei",
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/gsyhei/GXSlideSegmentController.git",
        "tag": "1.0.3"
    },
    "requires_arc": true,
    "source_files": "GXSlideSegmentDemo/GXSlideSegmentController/*.{h,m}"
}

Pin It on Pinterest

Share This