-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScrollableContainer.h
60 lines (41 loc) · 1.66 KB
/
ScrollableContainer.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
//
// ScrollableContainer.h
// YellowPages
//
// Created by Anil Can Baykal on 12/24/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef enum _ScrollableContainerType {
HorizontalScrollableContainer,
VerticalScrollableContainer,
}ScrollableContainerType;
@interface ScrollableContainer : UIScrollView {
BOOL isScrollable;
CGFloat marginX; // margins for subviews horizontal
CGFloat marginY; // margins for subviews vertical
CGFloat _currentY; // obviously not thread safe..
CGFloat _currentX;
CGSize _currentScrollableSize;
CGFloat leftMargin;
CGFloat topMargin;
CGFloat rightMargin;
CGFloat bottomMargin;
BOOL scrollable; // if not expandable, is it scrollable. have little effect if it is expandable
BOOL expandable; // does actual size(frame) expands with each subview
ScrollableContainerType _type;
}
@property (nonatomic, readonly) ScrollableContainerType type;
@property (nonatomic, assign, setter = setExpandable:, getter = isExpandable) BOOL expandable;
@property (nonatomic, assign, setter = setScrollable:, getter = isScrollable) BOOL scrollable;
@property (nonatomic, assign) CGFloat leftMargin;
@property (nonatomic, assign) CGFloat rightMargin;
@property (nonatomic, assign) CGFloat bottomMargin;
@property (nonatomic, assign) CGFloat topMargin;
@property (nonatomic, assign) CGFloat marginX;
@property (nonatomic, assign) CGFloat marginY;
-(void)removeAllSubviews;
-(void)appendView:(UIView*)v;
-(void)scrollToView:(UIView*)v animated:(BOOL)animated;
-(void)scrollToView:(UIView*)v ;
@end