-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDetailCell.m
35 lines (28 loc) · 920 Bytes
/
DetailCell.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
//
// DetailCell.m
// Part of the ASIHTTPRequest sample project - see http://allseeing-i.com/ASIHTTPRequest for details
//
// Created by Ben Copsey on 16/06/2010.
// Copyright 2010 All-Seeing Interactive. All rights reserved.
//
#import "DetailCell.h"
@implementation DetailCell
+ (id)cell
{
DetailCell *cell = [[[DetailCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"HeaderCell"] autorelease];
[[cell detailTextLabel] setTextAlignment:UITextAlignmentLeft];
[[cell detailTextLabel] setFont:[UIFont systemFontOfSize:14]];
return cell;
}
- (void)layoutSubviews
{
[super layoutSubviews];
int tablePadding = 40;
int tableWidth = [[self superview] frame].size.width;
if (tableWidth > 480) { // iPad
tablePadding = 110;
}
[[self textLabel] setFrame:CGRectMake(5,5,120,20)];
[[self detailTextLabel] setFrame:CGRectMake(135,5,[self frame].size.width-145-tablePadding,20)];
}
@end