are you trying to have it in a tableview like that?
well if not all you really need is...
Code:
- (void)create_Custom_UISlider
{
CGRect frame = CGRectMake(0.0, 0.0, 300, 52.0);
CGRect thumb = CGRectMake(0.0, 0.0, 71.0, 47.0);
customSlider = [[UISlider alloc] initWithFrame:frame];
[customSlider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
// in case the parent view draws with a custom color or gradient, use a transparent color
customSlider.backgroundColor = [UIColor clearColor];
UIImage *stetchLeftTrack = [[UIImage imageNamed:@"customTrack.png"]
stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
UIImage *stetchRightTrack = [[UIImage imageNamed:@"customTrack.png"]
stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
[customSlider setThumbImage: [UIImage imageNamed:@"customThumb.png"] forState:UIControlStateNormal];
[customSlider setMinimumTrackImage:stetchLeftTrack forState:UIControlStateNormal];
[customSlider setMaximumTrackImage:stetchRightTrack forState:UIControlStateNormal];
[customSlider thumbRectForBounds: thumb trackRect: frame value: customSlider.value];
customSlider.minimumValue = 0.0;
customSlider.maximumValue = 100.0;
customSlider.continuous = NO;
customSlider.value = 5.0;
}
and then in your viewdidLoad....
Code:
- (void)viewDidLoad{
[self create_Custom_UISlider];
}