forked from huobazi/DSBBM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChatFootbarView.m
114 lines (93 loc) · 3.44 KB
/
ChatFootbarView.m
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//
// ChatFootbarView.m
// BmobIMDemo
//
// Created by Bmob on 14-7-2.
// Copyright (c) 2014年 bmob. All rights reserved.
//
#import "ChatFootbarView.h"
@implementation ChatFootbarView
@synthesize libButton = _libButton;
@synthesize takeButton = _takeButton;
@synthesize locationButton = _locationButton;
@synthesize libLabel = _libLabel;
@synthesize takeLabel = _takeLabel;
@synthesize locationLabel = _locationLabel;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
-(UIButton *)libButton{
if (!_libButton) {
_libButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_libButton setImage:[UIImage imageNamed:@"Photo"] forState:UIControlStateNormal];
[_libButton setImage:[UIImage imageNamed:@"Photoselect"] forState:UIControlStateHighlighted];
[self addSubview:_libButton];
}
return _libButton;
}
-(UIButton*)takeButton{
if (!_takeButton) {
_takeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_takeButton setImage:[UIImage imageNamed:@"Camera"] forState:UIControlStateNormal];
[_takeButton setImage:[UIImage imageNamed:@"Cameraselect"] forState:UIControlStateHighlighted];
[self addSubview:_takeButton];
}
return _takeButton;
}
-(UIButton *)locationButton{
if (!_locationButton) {
_locationButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_locationButton setImage:[UIImage imageNamed:@"chat_icon7"] forState:UIControlStateNormal];
[_locationButton setImage:[UIImage imageNamed:@"chat_icon7_"] forState:UIControlStateHighlighted];
[self addSubview:_locationButton];
}
return _locationButton;
}
-(UILabel *)libLabel{
if (!_libLabel) {
_libLabel = [[UILabel alloc] init];
_libLabel.backgroundColor = [UIColor clearColor];
_libLabel.font = [UIFont systemFontOfSize:13];
// _libLabel.textColor = RGB(124, 127, 131, 1.0f);
_libLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_libLabel];
}
return _libLabel;
}
-(UILabel *)takeLabel{
if (!_takeLabel) {
_takeLabel = [[UILabel alloc] init];
_takeLabel.backgroundColor = [UIColor clearColor];
_takeLabel.font = [UIFont systemFontOfSize:13];
// _takeLabel.textColor = RGB(124, 127, 131, 1.0f);
_takeLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_takeLabel];
}
return _takeLabel;
}
-(UILabel *)locationLabel{
if (!_locationLabel) {
_locationLabel = [[UILabel alloc] init];
_locationLabel.backgroundColor = [UIColor clearColor];
_locationLabel.font = [UIFont systemFontOfSize:13];
// _locationLabel.textColor = RGB(124, 127, 131, 1.0f);
_locationLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_locationLabel];
}
return _locationLabel;
}
-(void)layoutSubviews{
[super layoutSubviews];
self.libButton.frame = CGRectMake(22, 16, 54, 54);
self.libLabel.frame = CGRectMake(22, 73, 54, 15);
self.takeButton.frame = CGRectMake(96, 16, 54, 54);
self.takeLabel.frame = CGRectMake(96, 73, 54, 15);
self.locationButton.frame = CGRectMake(170, 16, 54, 54);
self.locationLabel.frame = CGRectMake(170, 73, 54, 15);
}
@end