89 lines
3.8 KiB
Objective-C
89 lines
3.8 KiB
Objective-C
//
|
|
// QXFamilyViewController.m
|
|
// QXLive
|
|
//
|
|
// Created by 启星 on 2025/11/26.
|
|
//
|
|
|
|
#import "QXFamilyViewController.h"
|
|
#import "QXFamilySubViewController.h"
|
|
|
|
@interface QXFamilyViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
|
@property (nonatomic,strong)UIImageView *topImageView;
|
|
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
|
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
|
@property (nonatomic,strong)NSMutableArray *titles;
|
|
@end
|
|
|
|
@implementation QXFamilyViewController
|
|
|
|
- (void)viewDidLoad {
|
|
self.isNoChangeBgImage = YES;
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view.
|
|
}
|
|
|
|
-(void)viewWillAppear:(BOOL)animated{
|
|
[super viewWillAppear:animated];
|
|
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
|
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0xffffff)};
|
|
}
|
|
-(void)viewWillDisappear:(BOOL)animated{
|
|
[super viewWillDisappear:animated];
|
|
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0x000000)};
|
|
}
|
|
-(void)setNavgationItems{
|
|
[super setNavgationItems];
|
|
self.navigationItem.title = QXText(@"家族");
|
|
self.navigationTintColor = RGB16(0xffffff);
|
|
}
|
|
- (void)initSubViews{
|
|
self.titles = [NSMutableArray arrayWithArray:@[@"我的家族",@"我加入的家族"]];
|
|
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_family_top_bg"]];
|
|
self.topImageView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(435));
|
|
[self.view addSubview:self.topImageView];
|
|
self.view.backgroundColor = RGB16(0x102477);
|
|
|
|
self.categoryView = [[JXCategoryTitleView alloc] init];
|
|
self.categoryView.frame = CGRectMake((self.view.width-246)/2, NavContentHeight+ScaleWidth(236), 246, 38);
|
|
self.categoryView.delegate = self;
|
|
self.categoryView.titles = self.titles;
|
|
self.categoryView.backgroundColor = RGB16A(0x000000, 0.2);
|
|
[self.categoryView addRoundedCornersWithRadius:19];
|
|
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"];
|
|
self.categoryView.titleColor = [UIColor colorWithHexString:@"#ffffff"];
|
|
self.categoryView.cellWidth = 123;
|
|
self.categoryView.contentEdgeInsetLeft = 0;
|
|
self.categoryView.cellSpacing = 0;
|
|
self.categoryView.contentEdgeInsetLeft = 0;
|
|
// self.categoryView.titleLabelZoomScale = 1.1;
|
|
// self.categoryView.titleLabelZoomEnabled = YES;
|
|
self.categoryView.titleFont = [UIFont boldSystemFontOfSize:14];
|
|
self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:14];
|
|
self.categoryView.averageCellSpacingEnabled = NO;
|
|
JXCategoryIndicatorBackgroundView *indicatorView = [[JXCategoryIndicatorBackgroundView alloc] init];
|
|
indicatorView.indicatorWidth = 123;
|
|
indicatorView.indicatorHeight = 38;
|
|
indicatorView.indicatorCornerRadius = 19;
|
|
indicatorView.indicatorColor = RGB16(0xA4FFB8);
|
|
self.categoryView.indicators = @[indicatorView];
|
|
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_CollectionView) delegate:self];
|
|
self.containerView.frame = CGRectMake(0, self.categoryView.bottom+8, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom-8);
|
|
[self.view addSubview:self.categoryView];
|
|
[self.view addSubview:self.containerView];
|
|
self.categoryView.listContainer = self.containerView;
|
|
}
|
|
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
|
return self.titles.count;
|
|
}
|
|
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
|
QXFamilySubViewController *vc = [[QXFamilySubViewController alloc] init];
|
|
vc.index = index;
|
|
return vc;
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|