// // YOUPAIHRLiveRankVC.m // VQU // // Created by xiaohaoran on 2021/10/19. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAIHRAccompanyRankVC.h" #import "JXCategoryView.h" #import "YOUPAIJXCategoryTitleBackgroundView.h" #import "JXCategoryListContainerView.h" #import "YOUPAIHRAccompanyRankDetailVC.h" @interface YOUPAIHRAccompanyRankVC () @end @implementation YOUPAIHRAccompanyRankVC - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; [self youpaifinitUI]; } - (void)youpaifinitUI{ YOUPAIJXCategoryTitleBackgroundView *categoryView = [[YOUPAIJXCategoryTitleBackgroundView alloc] init];//WithFrame:CGRectMake(0.0f, 14.0f, KScreenWidth, 26.0f) categoryView.backgroundColor = [UIColor clearColor]; categoryView.titles = self.titles; categoryView.delegate = self; categoryView.titleColor = LZ273145Color; categoryView.titleSelectedColor = [UIColor whiteColor]; // categoryView.titleColorGradientEnabled = YES; // categoryView.titleLabelMaskEnabled = YES; categoryView.titleFont = LCFont(12.0f); categoryView.titleSelectedFont = [UIFont systemFontOfSize:12]; categoryView.cellWidth = 64.0f; categoryView.cellSpacing = 0; categoryView.averageCellSpacingEnabled = NO; categoryView.normalBackgroundColor = UIColor.clearColor;; categoryView.selectedBackgroundColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(64.0f, 27.0f) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:GradientLeftToRight]]; categoryView.cellWidthIncrement = 0; categoryView.contentEdgeInsetLeft = ScaleSize(90); categoryView.contentEdgeInsetRight = ScaleSize(90); categoryView.normalBorderColor = [UIColor clearColor]; categoryView.selectedBorderColor = [UIColor clearColor]; categoryView.borderLineWidth = 0; categoryView.backgroundCornerRadius = 13.0f; categoryView.backgroundWidth = JXCategoryViewAutomaticDimension; categoryView.backgroundHeight = 26.0f; [self.view addSubview:categoryView]; JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self]; // pagerView.listCellBackgroundColor = LCBkgColor; // pagerView.frame = CGRectMake(0.0f, CGRectGetMaxY(categoryView.frame) + 14.0f, KScreenWidth, KScreenHeight - CGRectGetMaxY(categoryView.frame) - NavBarHeight - 10.0f - TabbarHeight - 14.0f); [self.view addSubview:pagerView]; categoryView.listContainer = pagerView; [categoryView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.offset(0.0f); make.top.offset(10); make.height.offset(28.0f); }]; [pagerView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.offset(0.0f); make.top.equalTo(categoryView.mas_bottom).offset(14.0f); }]; } #pragma mark - JXCategoryListContainerViewDelegate - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{ return self.titles.count; } - (id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ // 周1 月2 总3 YOUPAIHRAccompanyRankDetailVC *vc = [[YOUPAIHRAccompanyRankDetailVC alloc] init]; vc.youpaiptype = self.types[index]; return vc; } - (NSArray *)titles{ return @[@"周榜",@"月榜",@"总榜"]; } - (NSArray *)types{ return @[@"1",@"2",@"3"]; } #pragma mark - JXCategoryListContainerView - (UIView *)listView{ return self.view; } @end