美文网首页
分段控件

分段控件

作者: leaderleader | 来源:发表于2017-11-18 10:04 被阅读0次

    //分段控件

    导入第三方 LBSegmentControlKit

    ViewController.m

    #define kScreen_width [UIScreen mainScreen].bounds.size.width

    #define kScreen_height [UIScreen mainScreen].bounds.size.height

    #import "RViewController.h"

    #import "YViewController.h"

    #import "KViewController.h"

    #import "ZViewController.h"

    #import "XViewController.h"

    #import "LBSegmentControl.h"

    //分段控件直接调用

    XViewController* XVC = [[XViewController alloc]init];

    ZViewController* ZVC = [[ZViewController alloc]init];

    KViewController* KVC = [[KViewController alloc]init];

    YViewController* YVC = [[YViewController alloc]init];

    RViewController* RVC = [[RViewController alloc]init];

    LBSegmentControl * segmentControl = [[LBSegmentControl alloc] initStaticTitlesWithFrame:CGRectMake(0, 20, kScreen_width, 45)];

    segmentControl.titles = @[@"想看", @"在看", @"看过",@"影评",@"影人",];

    segmentControl.viewControllers = @[XVC,ZVC,KVC,YVC,RVC];

    segmentControl.titleNormalColor = [UIColor grayColor];

    segmentControl.titleSelectColor = [UIColor blackColor];

    [segmentControl setBottomViewColor:[UIColor blackColor]];

    segmentControl.isTitleScale = YES;

    [self.view addSubview:segmentControl];

    相关文章

      网友评论

          本文标题:分段控件

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