单军华
2018-07-11 7b02207537d35bfa1714bf8beafc921f717d100a
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
//
//  ZJSegmentStyle.m
//  ZJScrollPageView
//
//  Created by jasnig on 16/5/6.
//  Copyright © 2016年 ZeroJ. All rights reserved.
//
 
#import "ZJSegmentStyle.h"
 
@implementation ZJSegmentStyle
 
- (instancetype)init {
    if(self = [super init]) {
        _showCover = NO;
        _showLine = NO;
        _scaleTitle = NO;
        _scrollTitle = YES;
        _segmentViewBounces = YES;
        _contentViewBounces = YES;
        _gradualChangeTitleColor = NO;
        _showExtraButton = NO;
        _scrollContentView = YES;
        _adjustCoverOrLineWidth = NO;
        _showImage = NO;
        _autoAdjustTitlesWidth = NO;
        _animatedContentViewWhenTitleClicked = YES;
        _extraBtnBackgroundImageName = nil;
        _scrollLineHeight = 2.0;
        _scrollLineColor = [UIColor brownColor];
        _coverBackgroundColor = [UIColor lightGrayColor];
        _coverCornerRadius = 14.0;
        _coverHeight = 28.0;
        _titleMargin = 15.0;
        _titleFont = [UIFont systemFontOfSize:14.0];
        _titleBigScale = 1.3;
        _normalTitleColor = [UIColor colorWithRed:51.0/255.0 green:53.0/255.0 blue:75/255.0 alpha:1.0];
        _selectedTitleColor = [UIColor colorWithRed:255.0/255.0 green:0.0/255.0 blue:121/255.0 alpha:1.0];
        
        _segmentHeight = 44.0;
 
    }
    return self;
}
 
 
- (void)setSegmentViewComponent:(SegmentViewComponent)segmentViewComponent {
 
    if (segmentViewComponent & SegmentViewComponentShowCover) {
        _showCover = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentShowLine) {
        _showLine = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentShowImage) {
        _showImage = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentShowExtraButton) {
        _showExtraButton = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentScaleTitle) {
        _scaleTitle = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentScrollTitle) {
        _scrollTitle = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentBounces) {
        _segmentViewBounces = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentGraduallyChangeTitleColor) {
        _gradualChangeTitleColor = YES;
    }
    else if (segmentViewComponent & SegmentViewComponentAdjustCoverOrLineWidth) {
        _adjustCoverOrLineWidth = YES;
    }
    else  {
        _autoAdjustTitlesWidth = YES;
    }
 
}
 
@end