// // YOUPAIHRsendRankVC.m // VQU // // Created by xiaohaoran on 2021/10/19. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAIHRsendRankVC.h" #import "JXCategoryView.h" #import "JXPagerView.h" #import "YOUPAIHRAccompanyRankVC.h" #import "YOUPAIHRLiveRankVC.h" #define LZCategoryViewHeight 44.0f #define LZCategoryViewItemWidth 34.0f @interface YOUPAIHRsendRankVC () @property (nonatomic, weak) JXCategoryListContainerView *youpaippagerView; @property (nonatomic, strong) JXCategoryTitleView *youpaipcategoryView; @property (strong, nonatomic) NSArray *youpaiptitlesArr; @end @implementation YOUPAIHRsendRankVC -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; self.navigationController.navigationBarHidden = YES; } -(void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; self.navigationController.navigationBarHidden = NO; } - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; self.youpaiptitlesArr = @[@"送礼榜"]; [self youpaifsetupUI]; } -(void)youpaifsetupUI{ UIView *categoryBgV = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0, KScreenWidth, LZCategoryViewHeight+StatusBarHeight)]; [self.view addSubview:categoryBgV]; // categoryBgV.backgroundColor = LCBkgColor; JXCategoryTitleView *categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, StatusBarHeight, KScreenWidth, LZCategoryViewHeight)]; // categoryView.backgroundColor = LCBkgColor; categoryView.titles = self.youpaiptitlesArr; categoryView.delegate = self; categoryView.titleSelectedColor = LZ273145Color; categoryView.titleColor = LZ273145Color; categoryView.titleColorGradientEnabled = YES; categoryView.titleFont = LCFont(18.0f); categoryView.titleSelectedFont = LCBoldFont(18.0f); categoryView.cellWidth = 55; // categoryView.contentEdgeInsetLeft = 0; // categoryView.contentEdgeInsetRight = 0; categoryView.averageCellSpacingEnabled = YES; [categoryBgV addSubview:categoryView]; self.youpaipcategoryView = categoryView; //返回 UIButton *cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(19, 11 + StatusBarHeight, 20, 20)]; [categoryBgV addSubview:cancelBtn]; [cancelBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_navigation_back_black"] forState:UIControlStateNormal]; [cancelBtn addTarget:self action:@selector(youpaifcancelButtonClick) forControlEvents:UIControlEventTouchUpInside]; JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init]; lineView.verticalMargin = 4.0f; lineView.indicatorHeight = 2.5f; lineView.indicatorWidth = 8; lineView.layer.cornerRadius = 1.25; lineView.layer.masksToBounds = YES; [lineView.layer addSublayer:[LCTools getGradientLayerWithSize:CGSizeMake(lineView.indicatorWidth, lineView.indicatorHeight) twoColors:@[HexColorFromRGB(0xffffff),HexColorFromRGB(0xFFFFFF)] gradientType:GradientLeftToRight]]; categoryView.indicators = @[lineView]; JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self]; // pagerView.listCellBackgroundColor = LCBkgColor; pagerView.frame = CGRectMake(0.0f, categoryBgV.mj_h, KScreenWidth, KScreenHeight - categoryBgV.mj_h - TabbarHeight+LZCategoryViewHeight); [self.view addSubview:pagerView]; self.youpaippagerView = pagerView; self.youpaipcategoryView.listContainer = self.youpaippagerView; } -(void)youpaifcancelButtonClick{ [self.navigationController popViewControllerAnimated:YES]; } // 返回列表的数量 - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView { return self.youpaiptitlesArr.count; } // 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例 - (id)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index { //1是陪伴榜 2直播榜 YOUPAIHRAccompanyRankVC *vc = [YOUPAIHRAccompanyRankVC new]; return vc; // if (index == 0) { // // }else{ // YOUPAIHRLiveRankVC *vc = [YOUPAIHRLiveRankVC new]; // return vc; // } } @end