101 lines
3.4 KiB
Objective-C
101 lines
3.4 KiB
Objective-C
//
|
|
// DDMyRoomHomeViewController.m
|
|
// DingDangApp
|
|
//
|
|
// Created by apple on 2023/6/20.
|
|
//
|
|
|
|
#import "DDMyRoomHomeViewController.h"
|
|
#import "DDMyRoomListViewController.h"
|
|
@interface DDMyRoomHomeViewController ()
|
|
|
|
@end
|
|
|
|
@implementation DDMyRoomHomeViewController
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view.
|
|
[self initNav];
|
|
[self creatV];
|
|
}
|
|
-(void)creatV
|
|
{
|
|
self.pagerView.pinSectionHeaderVerticalOffset = CGFLOAT_MIN;
|
|
self.categoryView.cellSpacing = 20;
|
|
self.categoryView.contentEdgeInsetLeft = 20;
|
|
self.categoryView.averageCellSpacingEnabled = NO;
|
|
self.pagerView.mainTableView.backgroundColor = UIColor.clearColor;
|
|
self.categoryView.titleSelectedColor = [UIColor jk_colorWithHexString:@"#333333"];
|
|
self.categoryView.titleColor = [UIColor jk_colorWithHexString:@"#999999"];
|
|
self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:15];
|
|
self.categoryView.titleFont = [UIFont systemFontOfSize:15];
|
|
self.categoryView.titleColorGradientEnabled = YES;
|
|
|
|
JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
|
|
lineView.indicatorWidth = 24;
|
|
lineView.lineStyle = JXCategoryIndicatorLineStyle_Lengthen;
|
|
lineView.verticalMargin = 5;
|
|
lineView.indicatorColor = UIColor.clearColor;
|
|
self.categoryView.indicators = @[lineView];
|
|
self.titlesArray = @[@"我的房间",@"我的收藏"].mutableCopy;
|
|
self.pagerView.mainTableView.bounces = NO;
|
|
[self.view addSubview:self.pagerView];
|
|
self.categoryView.defaultSelectedIndex = 0;
|
|
self.categoryView.titles = self.titlesArray;
|
|
[self.pagerView reloadData];
|
|
}
|
|
- (JXPagerView *)preferredPagingView {
|
|
return [[JXPagerView alloc] initWithDelegate:self];
|
|
}
|
|
- (void)viewDidLayoutSubviews {
|
|
|
|
[super viewDidLayoutSubviews];
|
|
self.pagerView.frame = CGRectMake(0, DDNavigationBarHeight(), kWidth, kHeight-DDNavigationBarHeight());
|
|
}
|
|
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
|
return [[UIView alloc] init];
|
|
}
|
|
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
|
return CGFLOAT_MIN;
|
|
}
|
|
|
|
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
|
return 44;
|
|
}
|
|
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
|
return self.categoryView;
|
|
}
|
|
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
|
|
return self.categoryView.titles.count;
|
|
}
|
|
- (void)pagerView:(JXPagerView *)pagerView mainTableViewDidScroll:(UIScrollView *)scrollView{
|
|
}
|
|
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
|
if (index==0) {
|
|
DDMyRoomListViewController * listVC = [[DDMyRoomListViewController alloc] init];
|
|
listVC.type = @"myRoom";
|
|
return listVC;
|
|
}else{
|
|
DDMyRoomListViewController * listVC = [[DDMyRoomListViewController alloc] init];
|
|
listVC.type = @"myFollow";
|
|
return listVC;
|
|
}
|
|
}
|
|
-(void)initNav
|
|
{
|
|
[self defaultNavTitle:@"我的房间" hideLine:YES];
|
|
}
|
|
|
|
/*
|
|
#pragma mark - Navigation
|
|
|
|
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
|
// Get the new view controller using [segue destinationViewController].
|
|
// Pass the selected object to the new view controller.
|
|
}
|
|
*/
|
|
|
|
@end
|