forked from devslashwill/WeeAppTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeeAppTest.mm
57 lines (44 loc) · 1.23 KB
/
WeeAppTest.mm
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
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BBWeeAppController-Protocol.h"
@interface WeeAppTestController : NSObject <BBWeeAppController>
{
UIView *_view;
}
+ (void)initialize;
- (UIView *)view;
@end
@implementation WeeAppTestController
+ (void)initialize
{
}
- (void)dealloc
{
[_view release];
[super dealloc];
}
- (UIView *)view
{
if (_view == nil)
{
_view = [[UIView alloc] initWithFrame:CGRectMake(2, 0, 316, 71)];
UIImage *bg = [[UIImage imageWithContentsOfFile:@"/System/Library/WeeAppPlugins/WeeAppTest.bundle/WeeAppBackground.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:71];
UIImageView *bgView = [[UIImageView alloc] initWithImage:bg];
bgView.frame = CGRectMake(0, 0, 316, 71);
[_view addSubview:bgView];
[bgView release];
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 316, 71)];
lbl.backgroundColor = [UIColor clearColor];
lbl.textColor = [UIColor whiteColor];
lbl.text = @"Hello World";
lbl.textAlignment = UITextAlignmentCenter;
[_view addSubview:lbl];
[lbl release];
}
return _view;
}
- (float)viewHeight
{
return 71.0f;
}
@end