/
CSVerticalLayoutManager.h
60 lines (51 loc) · 1.41 KB
/
CSVerticalLayoutManager.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
//
// VerticalLayoutManager.h
// TabBarApp
//
// Created by Marcin Maciukiewicz on 13/04/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CSLayoutableWidget.h"
enum {
VerticalAlignTop,
VerticalAlignCenter,
VerticalAlignBottom
} typedef VerticalAlign;
enum {
HorizontalAlignLeft,
HorizontalAlignCenter,
HorizontalAlignRight
} typedef HorizontalAlign;
struct {
CGFloat top;
CGFloat right;
CGFloat bottom;
CGFloat left;
} typedef Distance;
CG_INLINE Distance DistanceMake(CGFloat top, CGFloat right, CGFloat bottom, CGFloat left) {
Distance size; size.top = top; size.right = right; size.bottom = bottom; size.left = left; return size;
}
@interface CSVerticalLayoutManager : NSObject {
VerticalAlign verticalAlign;
HorizontalAlign horizontalAlign;
UIView *_view;
NSMutableArray *_subviews;
NSArray *_visibleSubviews;
CGSize spacing;
Distance padding;
BOOL ignoreHidden;
}
@property(nonatomic,retain) UIView *_view;
@property(nonatomic,assign) NSMutableArray *_subviews;
@property(nonatomic,assign) NSArray *_visibleSubviews;
@property CGSize spacing;
@property Distance padding;
@property VerticalAlign verticalAlign;
@property HorizontalAlign horizontalAlign;
@property BOOL ignoreHidden;
-(id)initWithView:(UIView*)view;
-(void)addSubview:(UIView*)subview;
-(void)layoutSubviews;
-(NSArray*)allSubviews;
@end