78 lines
3.3 KiB
Objective-C
78 lines
3.3 KiB
Objective-C
//
|
|
// QXBackpackViewController.m
|
|
// QXLive
|
|
//
|
|
// Created by 启星 on 2025/5/9.
|
|
//
|
|
|
|
#import "QXBackpackViewController.h"
|
|
#import "JXCategoryView.h"
|
|
#import "QXBackpackSubViewController.h"
|
|
|
|
@interface QXBackpackViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
|
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
|
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
|
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
|
@property (nonatomic,strong)NSArray *titles;
|
|
@end
|
|
|
|
@implementation QXBackpackViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view.
|
|
}
|
|
-(void)viewWillAppear:(BOOL)animated{
|
|
[super viewWillAppear:animated];
|
|
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
|
}
|
|
-(void)setNavgationItems{
|
|
[super setNavgationItems];
|
|
self.navigationItem.title = @"我的背包";
|
|
}
|
|
- (void)initSubViews{
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
self.titles = @[QXText(@"背包道具"),QXText(@"背包收入"),QXText(@"背包支出")];
|
|
self.listVCArray = [NSMutableArray array];
|
|
self.categoryView = [[JXCategoryTitleView alloc] init];
|
|
self.categoryView.frame = CGRectMake(15, kSafeAreaTop+44, SCREEN_WIDTH-30, 44);
|
|
self.categoryView.delegate = self;
|
|
self.categoryView.titles = self.titles;
|
|
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"];
|
|
self.categoryView.titleColor = [UIColor colorWithHexString:@"#666666"];
|
|
self.categoryView.cellWidth = JXCategoryViewAutomaticDimension;
|
|
self.categoryView.contentEdgeInsetLeft = 0;
|
|
self.categoryView.cellSpacing = 18;
|
|
self.categoryView.contentEdgeInsetLeft = 8;
|
|
// self.categoryView.titleLabelZoomScale = 1.1;
|
|
self.categoryView.titleLabelZoomEnabled = YES;
|
|
self.categoryView.titleFont = [UIFont boldSystemFontOfSize:14];
|
|
self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16];
|
|
self.categoryView.averageCellSpacingEnabled = NO;
|
|
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
|
|
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
|
indicatorView.indicatorImageViewSize = CGSizeMake(40, 8);
|
|
indicatorView.verticalMargin = 11;
|
|
self.categoryView.indicators = @[indicatorView];
|
|
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_ScrollView) delegate:self];
|
|
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
|
|
[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{
|
|
QXBackpackSubViewController *vc = [[QXBackpackSubViewController alloc] init];
|
|
vc.type = index;
|
|
return vc;
|
|
}
|
|
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
|
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
|
|
}
|
|
|
|
|
|
@end
|