fix
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "HomeRankVC.h"
|
||||
#import "HomeRankContentVC.h"
|
||||
#import "KBCategoryTitleImageView.h"
|
||||
|
||||
@interface HomeRankVC ()<JXCategoryViewDelegate>
|
||||
@property (nonatomic, strong) NSArray *titles;
|
||||
@@ -114,9 +115,10 @@
|
||||
// 分页菜单视图
|
||||
- (JXCategoryTitleImageView *)myCategoryView {
|
||||
if (!_myCategoryView) {
|
||||
_myCategoryView = [[JXCategoryTitleImageView alloc] init];
|
||||
// Use our subclass so cells get a 4pt rounded background locally
|
||||
_myCategoryView = (JXCategoryTitleImageView *)[[KBCategoryTitleImageView alloc] init];
|
||||
_myCategoryView.delegate = self;
|
||||
|
||||
|
||||
// !!!: 将列表容器视图关联到 categoryView
|
||||
_myCategoryView.listContainer = self.listContainerView;
|
||||
}
|
||||
|
||||
14
keyBoard/Class/Shop/V/KBCategoryTitleImageCell.h
Normal file
14
keyBoard/Class/Shop/V/KBCategoryTitleImageCell.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// KBCategoryTitleImageCell.h
|
||||
// keyBoard
|
||||
//
|
||||
// A JXCategoryTitleImageCell subclass that rounds the cell's contentView
|
||||
// without changing the third-party JXCategoryView source code.
|
||||
//
|
||||
|
||||
#import <JXCategoryView/JXCategoryTitleImageCell.h>
|
||||
|
||||
@interface KBCategoryTitleImageCell : JXCategoryTitleImageCell
|
||||
|
||||
@end
|
||||
|
||||
28
keyBoard/Class/Shop/V/KBCategoryTitleImageCell.m
Normal file
28
keyBoard/Class/Shop/V/KBCategoryTitleImageCell.m
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// KBCategoryTitleImageCell.m
|
||||
// keyBoard
|
||||
//
|
||||
// Sets `contentView.layer.cornerRadius = 4` for title+image cells, so the
|
||||
// background color that JXCategoryView applies is shown as a rounded rect.
|
||||
//
|
||||
|
||||
#import "KBCategoryTitleImageCell.h"
|
||||
|
||||
@implementation KBCategoryTitleImageCell
|
||||
|
||||
- (void)initializeViews {
|
||||
[super initializeViews];
|
||||
// Round the cell background once; keep clipping within the rounded rect.
|
||||
self.contentView.layer.cornerRadius = 4.0;
|
||||
self.contentView.layer.masksToBounds = YES;
|
||||
}
|
||||
|
||||
// Defensive: if layout changes reset layer (some frameworks tweak layers in layout)
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
self.contentView.layer.cornerRadius = 4.0;
|
||||
self.contentView.layer.masksToBounds = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
14
keyBoard/Class/Shop/V/KBCategoryTitleImageView.h
Normal file
14
keyBoard/Class/Shop/V/KBCategoryTitleImageView.h
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// KBCategoryTitleImageView.h
|
||||
// keyBoard
|
||||
//
|
||||
// Registers KBCategoryTitleImageCell so we can round cells locally
|
||||
// without touching the JXCategoryView pod.
|
||||
//
|
||||
|
||||
#import <JXCategoryView/JXCategoryTitleImageView.h>
|
||||
|
||||
@interface KBCategoryTitleImageView : JXCategoryTitleImageView
|
||||
|
||||
@end
|
||||
|
||||
18
keyBoard/Class/Shop/V/KBCategoryTitleImageView.m
Normal file
18
keyBoard/Class/Shop/V/KBCategoryTitleImageView.m
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// KBCategoryTitleImageView.m
|
||||
// keyBoard
|
||||
//
|
||||
// Use our rounded KBCategoryTitleImageCell for this view instance.
|
||||
//
|
||||
|
||||
#import "KBCategoryTitleImageView.h"
|
||||
#import "KBCategoryTitleImageCell.h"
|
||||
|
||||
@implementation KBCategoryTitleImageView
|
||||
|
||||
- (Class)preferredCellClass {
|
||||
return [KBCategoryTitleImageCell class];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user