YOUPAIHRLiveRankVC.m 3.5 KB

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