-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyUITableViewCell.m
66 lines (52 loc) · 1.87 KB
/
MyUITableViewCell.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
//
// MyUITableViewCell.m
// Images Sharer
//
// Created by Fabio L Brandao FH on 17/11/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "MyUITableViewCell.h"
#define MAINLABEL_TAG 1
#define THUMB_TAG 3
#define SECONDLABEL_TAG 2
@implementation MyUITableViewCell
@synthesize mainLabel;
@synthesize secondLabel;
@synthesize img;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
UIView *myContentView = self.contentView;
mainLabel = [[UILabel alloc] initWithFrame:CGRectMake(90.0, 15.0, 200.0, 25.0)];
mainLabel.tag = MAINLABEL_TAG;
mainLabel.font = [UIFont systemFontOfSize:14.0];
mainLabel.textAlignment = UITextAlignmentLeft;
mainLabel.textColor = [UIColor blackColor];
[myContentView addSubview:mainLabel];
secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(90.0, 40.0, 200.0, 20.0)];
secondLabel.tag = SECONDLABEL_TAG;
secondLabel.font = [UIFont systemFontOfSize:12.0];
secondLabel.textAlignment = UITextAlignmentLeft;
secondLabel.textColor = [UIColor darkGrayColor];
[myContentView addSubview:secondLabel];
thumb = [[UIImageView alloc] initWithFrame:CGRectMake(5, 2, 70, 70)];
thumb.tag = THUMB_TAG;
[myContentView addSubview:thumb];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
#pragma
#pragma mark - other methods
- (void)setData:(VOSearch *)vOSearch{
self.mainLabel.text = vOSearch.name;
self.secondLabel.text = vOSearch.font;
img = [[UIImage alloc] initWithData:vOSearch.image];
thumb.image = img;
}
@end