forked from cubewang/NewsReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettingCell.m
53 lines (38 loc) · 1.62 KB
/
SettingCell.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
//
// SettingCell.m
// EnglishFun
//
// Created by curer on 12-1-10.
// Copyright 2012 iKnow Team. All rights reserved.
//
#import "SettingCell.h"
@implementation SettingCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code.
if ([[UIDevice currentDevice]userInterfaceIdiom ] == UIUserInterfaceIdiomPhone) {
UIImage *backgroundImage;
NSString *backgroundImagePath = [[NSBundle mainBundle] pathForResource:@"CellBackground" ofType:@"png"];
backgroundImage = [[UIImage imageWithContentsOfFile:backgroundImagePath]
stretchableImageWithLeftCapWidth:0.0 topCapHeight:1.0];
self.backgroundView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease];
self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.backgroundView.frame = self.bounds;
// set selection color
UIView *backgroundView = [[UIView alloc] initWithFrame:self.frame];
backgroundView.backgroundColor = SELECTED_BACKGROUND;
self.selectedBackgroundView = backgroundView;
[backgroundView release];
}
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state.
}
- (void)dealloc {
[super dealloc];
}
@end