-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSTKSelectionHeaderView.m
More file actions
43 lines (35 loc) · 1.45 KB
/
STKSelectionHeaderView.m
File metadata and controls
43 lines (35 loc) · 1.45 KB
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
#import "STKSelectionHeaderView.h"
#import "STKConstants.h"
#import <SpringBoard/SpringBoard.h>
@implementation STKSelectionHeaderView
{
SBWallpaperEffectView *_wallpaperEffectView;
UILabel *_titleLabel;
}
- (instancetype)initWithFrame:(CGRect)frame
{
if ((self = [super initWithFrame:frame])) {
_wallpaperEffectView = [[[CLASS(SBWallpaperEffectView) alloc] initWithWallpaperVariant:SBWallpaperVariantHomeScreen] autorelease];
_wallpaperEffectView.frame = self.bounds;
_wallpaperEffectView.center = (CGPoint){CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds)};
_wallpaperEffectView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
[_wallpaperEffectView setStyle:(IS_9_0() ? 3 : 2)];
_titleLabel = [[[UILabel alloc] initWithFrame:self.bounds] autorelease];
_titleLabel.autoresizingMask = _wallpaperEffectView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
_titleLabel.font = [UIFont fontWithName:@"Helvetica Neue" size:18.f];
_titleLabel.textColor = [UIColor colorWithWhite:1.f alpha:0.7f];
_titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_wallpaperEffectView];
[self addSubview:_titleLabel];
}
return self;
}
- (void)setHeaderTitle:(NSString *)title
{
_titleLabel.text = title;
}
- (NSString *)headerTitle
{
return _titleLabel.text;
}
@end