12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //
- // JXCategoryTitleBackgroundView.m
- // JXCategoryView
- //
- // Created by jiaxin on 2019/8/16.
- // Copyright © 2019 jiaxin. All rights reserved.
- //
- #import "JXCategoryTitleBackgroundView.h"
- @implementation JXCategoryTitleBackgroundView
- - (void)initializeData {
- [super initializeData];
- self.cellWidthIncrement = 0;
- self.normalBackgroundColor = [UIColor whiteColor];
- self.normalBorderColor = RQ_MAIN_LINE_COLOR_1;
- self.selectedBackgroundColor = RQ_MAIN_COLOR;
- self.selectedBorderColor = RQ_MAIN_COLOR;
- self.borderLineWidth = 1;
- self.backgroundCornerRadius = 3;
- self.backgroundWidth = JXCategoryViewAutomaticDimension;
- self.backgroundHeight = 37;
- }
- //返回自定义的cell class
- - (Class)preferredCellClass {
- return [JXCategoryTitleBackgroundCell class];
- }
- - (void)refreshDataSource {
- NSMutableArray *tempArray = [NSMutableArray array];
- for (int i = 0; i < self.titles.count; i++) {
- JXCategoryTitleBackgroundCellModel *cellModel = [[JXCategoryTitleBackgroundCellModel alloc] init];
- [tempArray addObject:cellModel];
- }
- self.dataSource = tempArray;
- }
- - (void)refreshCellModel:(JXCategoryBaseCellModel *)cellModel index:(NSInteger)index {
- [super refreshCellModel:cellModel index:index];
- JXCategoryTitleBackgroundCellModel *myModel = (JXCategoryTitleBackgroundCellModel *)cellModel;
- myModel.normalBackgroundColor = self.normalBackgroundColor;
- myModel.normalBorderColor = self.normalBorderColor;
- myModel.selectedBackgroundColor = self.selectedBackgroundColor;
- myModel.selectedBorderColor = self.selectedBorderColor;
- myModel.borderLineWidth = self.borderLineWidth;
- myModel.backgroundCornerRadius = self.backgroundCornerRadius;
- myModel.backgroundWidth = self.backgroundWidth;
- myModel.backgroundHeight = self.backgroundHeight;
- }
- @end
|