-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettingsSliderCell.m
41 lines (33 loc) · 996 Bytes
/
SettingsSliderCell.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
//
// SettingsSliderCell.m
// OOOTouch
//
// Created by Edward Rudd on 4/8/10.
// Copyright 2010 OutOfOrder.cc. All rights reserved.
//
#import "SettingsSliderCell.h"
@implementation SettingsSliderCell
@synthesize slider = _slider;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
_slider = [[UISlider alloc] initWithFrame:CGRectZero];
[self.contentView addSubview:_slider];
self.selectionStyle = UITableViewCellSelectionStyleNone;
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
// determine the content rect for the cell. This will change depending on the
// style of table (grouped vs plain)
CGRect contentRect = self.contentView.bounds;
contentRect.origin.x += 10;
contentRect.size.width -= 20;
_slider.frame = contentRect;
}
- (void) dealloc
{
[_slider release];
[super dealloc];
}
@end