I have implemented ipad application in which i want to implement slider same as calendar application in ipad.i dont know how to implement.please help me for this query.
Thanks in advance.
I have implemented ipad application in which i want to implement slider same as calendar application in ipad.i dont know how to implement.please help me for this query.
Thanks in advance.
Dear mohsinpathan,
Custom sliders for iPhone and iPad are easy to implement with 3 static images. The iOS manages user interaction and display. The challenge for you will be to create resource images.
Good luck!
// Create Slider
UISlider slider = [[[UISlider alloc] initWithFrame:CGRectMake(10, 10, 300, 20)] autorelease];
// Set thumb image
[slider setThumbImage:[UIImage imageNamed:@"image-thumb.png"] forState:UIControlStateNormal];
// Set left image
[slider setMinimumTrackImage:[[UIImage imageNamed:@"image-left.png"] stretchableImageWithLeftCapWidth:12 topCapHeight:0] forState:UIControlStateNormal];
// Set left image
[slider setMaximumTrackImage:[[UIImage imageNamed:@"image-right.png"] stretchableImageWithLeftCapWidth:12 topCapHeight:0] forState:UIControlStateNormal];
// Set slider value, min and max
slider.minimumValue = 1;
slider.maximumValue = 100;
slider.value = 1;
// Add slider to view, self is a UIViewController
[self.view addSubview:slider];