forked from veader/V8HorizontalPickerView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
V8HorizontalPickerView.h
66 lines (45 loc) · 2.18 KB
/
V8HorizontalPickerView.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
//
// V8HorizontalPickerView.h
//
// Created by Shawn Veader on 9/17/10.
// Copyright 2010 V8 Labs, LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "V8HorizontalPickerViewProtocol.h"
// position of indicator view, if shown
typedef enum {
V8HorizontalPickerIndicatorBottom = 0,
V8HorizontalPickerIndicatorTop
} V8HorizontalPickerIndicatorPosition;
@interface V8HorizontalPickerView : UIView <UIScrollViewDelegate> { }
// delegate and datasources to feed scroll view. this view only maintains a weak reference to these
@property (nonatomic, weak) IBOutlet id <V8HorizontalPickerViewDataSource> dataSource;
@property (nonatomic, weak) IBOutlet id <V8HorizontalPickerViewDelegate> delegate;
@property (nonatomic, readonly) NSInteger numberOfElements;
@property (nonatomic, readonly) NSInteger currentSelectedIndex;
// what font to use for the element labels?
@property (nonatomic, strong) UIFont *elementFont;
// color of labels used in picker
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, strong) UIColor *selectedTextColor; // color of current selected element
// the point, defaults to center of view, where the selected element sits
@property (nonatomic, assign) CGPoint selectionPoint;
@property (nonatomic, strong) UIView *selectionIndicatorView;
@property (nonatomic, assign) V8HorizontalPickerIndicatorPosition indicatorPosition;
// views to display on edges of picker (eg: gradients, etc)
@property (nonatomic, strong) UIView *leftEdgeView;
@property (nonatomic, strong) UIView *rightEdgeView;
// views for left and right of scrolling area
@property (nonatomic, strong) UIView *leftScrollEdgeView;
@property (nonatomic, strong) UIView *rightScrollEdgeView;
// padding for left/right scroll edge views
@property (nonatomic, assign) CGFloat scrollEdgeViewPadding;
- (void)reloadData;
- (void)scrollToElement:(NSInteger)index animated:(BOOL)animate;
@end
// sub-class of UILabel that knows how to change it's state
@interface V8HorizontalPickerLabel : UILabel <V8HorizontalPickerElementState> { }
@property (nonatomic, assign) BOOL selectedElement;
@property (nonatomic, strong) UIColor *selectedStateColor;
@property (nonatomic, strong) UIColor *normalStateColor;
@end