分段控件

//分段控件

导入第三方 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];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容