当前位置:   article > 正文

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

jxcategorytitleview

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;
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88

VTProgress_HUD

[OCProgress_HUD setMaxSupportedWindowLevel:UIWindowLevelAlert];
[OCProgress_HUD setMinimumDismissTimeInterval:1.5];
[OCProgress_HUD setDarkStyle];
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/787369
推荐阅读
相关标签
  

闽ICP备14008679号