OC 常用第三方框架使用记录一

JXCategoryView

#import <JXCategoryView.h>
#pragma mark ------- JXCategoryListContentViewDelegate -------

- (UIView *)listView {
    return self.view;
}

@property (nonatomic, strong) JXCategoryTitleView *jk_categoryView; // 分页
@property (nonatomic, strong) JXCategoryIndicatorLineView *indicator;
@property (nonatomic, strong) JXCategoryListContainerView *jk_listContainerView;
@property (nonatomic, strong) JXCategoryIndicatorBackgroundView *backgroundView; // 背景

- (JXCategoryTitleView *)jk_categoryView {
    if (!_jk_categoryView) {
        _jk_categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
        _jk_categoryView.titles = @[@"直播", @"关注", @"视频", @"附近"];
        _jk_categoryView.averageCellSpacingEnabled = NO;
        _jk_categoryView.titleLabelVerticalOffset = kAdaptedFloat(5);
        _jk_categoryView.cellSpacing = kAdaptedFloat(35);
        _jk_categoryView.cellWidth = kAdaptedFloat(20);
        _jk_categoryView.titleColor = k_Color_TipColor;
        _jk_categoryView.titleSelectedColor = [UIColor blackColor];
        _jk_categoryView.titleFont = kAdaptedFontSize(16);
        _jk_categoryView.titleSelectedFont = kAdaptedFontSize(22);
        _jk_categoryView.contentEdgeInsetLeft = kAdaptedFloat(25);
        _jk_categoryView.indicators = @[self.indicator];
    }
    return _jk_categoryView;
}

- (JXCategoryIndicatorLineView *)indicator {
    if (!_indicator) {
        _indicator = [[JXCategoryIndicatorLineView alloc] init];
        _indicator.indicatorColor = k_Color_themeColor;
        _indicator.indicatorWidth = kAdaptedFloat(21);
        _indicator.verticalMargin = kAdaptedFloat(5);
    }
    return _indicator;
}

- (JXCategoryListContainerView *)jk_listContainerView {
    if (!_jk_listContainerView) {
        _jk_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
        self.jk_categoryView.listContainer = _jk_listContainerView;
    }
    return _jk_listContainerView;
}

- (JXCategoryIndicatorBackgroundView *)backgroundView {
    if (!_backgroundView) {
        _backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init];
        _backgroundView.indicatorColor = [UIColor clearColor];
        _backgroundView.indicatorHeight = kAdaptedFloat(24);
        _backgroundView.indicatorCornerRadius = kAdaptedFloat(24) / 2;
        _backgroundView.borderColor = [UIColor blackColor];
        _backgroundView.borderWidth = 1;
    }
    return _backgroundView;
}

#pragma mark ------- JXCategoryListContainerViewDelegate -------

//返回列表的数量
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
    return self.jk_categoryView.titles.count;
}

//根据下标index返回对应遵从`JXCategoryListContentViewDelegate`协议的列表实例
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
    
    switch (index) {
        case 0:
        {
            QXLiveViewController *vc = [[QXLiveViewController alloc] init];
            vc.interFace = Home_GetHot;
            return vc;
        }
            break;

        default:
        {
            QXLiveViewController *vc = [[QXLiveViewController alloc] init];
            vc.interFace = Home_GetNearby;
            return vc;
        }
            break;
    }
}

VTProgress_HUD

[OCProgress_HUD setMaxSupportedWindowLevel:UIWindowLevelAlert];
[OCProgress_HUD setMinimumDismissTimeInterval:1.5];
[OCProgress_HUD setDarkStyle];
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值