YOUPAIHRAccompanyRankVC.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. //
  2. // YOUPAIHRLiveRankVC.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/10/19.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRAccompanyRankVC.h"
  9. #import "JXCategoryView.h"
  10. #import "YOUPAIJXCategoryTitleBackgroundView.h"
  11. #import "JXCategoryListContainerView.h"
  12. #import "YOUPAIHRAccompanyRankDetailVC.h"
  13. @interface YOUPAIHRAccompanyRankVC ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
  14. @end
  15. @implementation YOUPAIHRAccompanyRankVC
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. self.view.backgroundColor = [UIColor whiteColor];
  19. [self youpaifinitUI];
  20. }
  21. - (void)youpaifinitUI{
  22. YOUPAIJXCategoryTitleBackgroundView *categoryView = [[YOUPAIJXCategoryTitleBackgroundView alloc] init];//WithFrame:CGRectMake(0.0f, 14.0f, KScreenWidth, 26.0f)
  23. categoryView.backgroundColor = [UIColor clearColor];
  24. categoryView.titles = self.titles;
  25. categoryView.delegate = self;
  26. categoryView.titleColor = LZ273145Color;
  27. categoryView.titleSelectedColor = [UIColor whiteColor];
  28. // categoryView.titleColorGradientEnabled = YES;
  29. // categoryView.titleLabelMaskEnabled = YES;
  30. categoryView.titleFont = LCFont(12.0f);
  31. categoryView.titleSelectedFont = [UIFont systemFontOfSize:12];
  32. categoryView.cellWidth = 64.0f;
  33. categoryView.cellSpacing = 0;
  34. categoryView.averageCellSpacingEnabled = NO;
  35. categoryView.normalBackgroundColor = UIColor.clearColor;;
  36. categoryView.selectedBackgroundColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(64.0f, 27.0f) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:GradientLeftToRight]];
  37. categoryView.cellWidthIncrement = 0;
  38. categoryView.contentEdgeInsetLeft = ScaleSize(90);
  39. categoryView.contentEdgeInsetRight = ScaleSize(90);
  40. categoryView.normalBorderColor = [UIColor clearColor];
  41. categoryView.selectedBorderColor = [UIColor clearColor];
  42. categoryView.borderLineWidth = 0;
  43. categoryView.backgroundCornerRadius = 13.0f;
  44. categoryView.backgroundWidth = JXCategoryViewAutomaticDimension;
  45. categoryView.backgroundHeight = 26.0f;
  46. [self.view addSubview:categoryView];
  47. JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
  48. // pagerView.listCellBackgroundColor = LCBkgColor;
  49. // pagerView.frame = CGRectMake(0.0f, CGRectGetMaxY(categoryView.frame) + 14.0f, KScreenWidth, KScreenHeight - CGRectGetMaxY(categoryView.frame) - NavBarHeight - 10.0f - TabbarHeight - 14.0f);
  50. [self.view addSubview:pagerView];
  51. categoryView.listContainer = pagerView;
  52. [categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
  53. make.left.right.offset(0.0f);
  54. make.top.offset(10);
  55. make.height.offset(28.0f);
  56. }];
  57. [pagerView mas_makeConstraints:^(MASConstraintMaker *make) {
  58. make.left.right.bottom.offset(0.0f);
  59. make.top.equalTo(categoryView.mas_bottom).offset(14.0f);
  60. }];
  61. }
  62. #pragma mark - JXCategoryListContainerViewDelegate
  63. - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
  64. return self.titles.count;
  65. }
  66. - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
  67. // 周1 月2 总3
  68. YOUPAIHRAccompanyRankDetailVC *vc = [[YOUPAIHRAccompanyRankDetailVC alloc] init];
  69. vc.youpaiptype = self.types[index];
  70. return vc;
  71. }
  72. - (NSArray <NSString *> *)titles{
  73. return @[@"周榜",@"月榜",@"总榜"];
  74. }
  75. - (NSArray <NSString *> *)types{
  76. return @[@"1",@"2",@"3"];
  77. }
  78. #pragma mark - JXCategoryListContainerView
  79. - (UIView *)listView{
  80. return self.view;
  81. }
  82. @end