forked from rs/SDSegmentedControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SDSegmentedControl.h
executable file
·85 lines (67 loc) · 3.42 KB
/
SDSegmentedControl.h
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
//
// SDSegmentedControl.h
// Created by Olivier Poitrey on 22/09/12.
// Contributed by Marius Rackwitz on 19/10/12
//
// #define SDSegmentedControlDebug 1
#import <UIKit/UIKit.h>
// Most inherited UI_APPERANCE_SELECTORs are ignored. You can use the following selectors
// to customize appearance:
// +[SDSegmentedControl appearance]
// +[SDSegmentView appearance]
// +[SDStainView appearance]
typedef enum {
SDSegmentedArrowPositionBottom,
SDSegmentedArrowPositionTop
} SDSegmentedArrowPosition;
typedef NS_ENUM(NSUInteger, SDSegmentedStainViewType) {
/// Round view behind the text
SDSegmentedStainViewTypeRound,
/// Line on the top of the text
SDSegmentedStainViewTypeLine
};
@interface SDSegmentedControl : UISegmentedControl <UIScrollViewDelegate>
@property (retain, nonatomic) UIColor *backgroundColor UI_APPEARANCE_SELECTOR;
@property (retain, nonatomic) UIColor *borderColor UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat borderWidth UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat arrowSize UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) SDSegmentedArrowPosition arrowPosition UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat arrowHeightFactor UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CFTimeInterval animationDuration UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat interItemSpace UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) UIEdgeInsets stainEdgeInsets UI_APPEARANCE_SELECTOR;
@property (retain, nonatomic) UIColor *shadowColor UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat shadowRadius UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat shadowOpacity UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGSize shadowOffset UI_APPEARANCE_SELECTOR;
@property (retain, nonatomic) UIFont *titleFont UI_APPEARANCE_SELECTOR;
@property (retain, nonatomic) UIFont *selectedTitleFont UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) BOOL centerSegmentsIfPossible UI_APPEARANCE_SELECTOR;
/**
Style of stain view.
By default is SDSegmentedStainViewTypeRound. If set to SDSegmentedStainViewTypeLine, stainEdgeInsets is ignored.
*/
@property (assign, nonatomic) SDSegmentedStainViewType stainViewType UI_APPEARANCE_SELECTOR;
/**
Height of stainView if stainViewType == SDSegmentedStainViewTypeLine
By default is set to 2
*/
@property (assign, nonatomic) CGFloat stainViewLineHeight UI_APPEARANCE_SELECTOR;
@property (assign,nonatomic) UIScrollView *scrollView;
@end
@interface SDSegmentView : UIButton
@property (assign, nonatomic) CGSize imageSize UI_APPEARANCE_SELECTOR;
@property (retain, nonatomic) UIFont *titleFont;
@property (retain, nonatomic) UIFont *selectedTitleFont;
@property (assign, nonatomic) CGSize titleShadowOffset UI_APPEARANCE_SELECTOR;
@end
@interface SDStainView : UIView <UIAppearance>
@property (retain, nonatomic) UIColor *backgroundColor UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat cornerRadius UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) UIEdgeInsets edgeInsets UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGSize shadowOffset UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat shadowBlur UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) UIColor *shadowColor UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) CGFloat innerStrokeLineWidth UI_APPEARANCE_SELECTOR;
@property (assign, nonatomic) UIColor *innerStrokeColor UI_APPEARANCE_SELECTOR;
@end