-1

Possible Duplicate:
UISlider with increments of 5

How to create slider and sliding the values increased by 10,20,30... & decreased by -10,-20,-30...in this format. help any other links for tutorial or source code. Advance in thanks

Community
  • 1
  • 1
Jaikannan
  • 57
  • 11
  • `UISlider` as is does not provide 'step' functionality - you'll have to subclass it (or add a delegate method to the class that uses it). – Rok Jarc Nov 09 '12 at 12:09

1 Answers1

0
UISlider* mySlider = [[UISlider alloc] init];
mySlider.minimumValue = -30.0f;
mySlider.maximumValue = 30.0f;  

-(IBAction) sliderChanged:(id) sender{

      UISlider *slider = (UISlider *) sender;
      int progressAsInt =(int)(slider.value + 0.5f);
      NSString *newText =[[NSString alloc]
                      initWithFormat:@"%d",progressAsInt];
      self.sliderLabel.text = newText;
}
Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102