0
  1. reference point. I am building an IOS application where I am using 2 sliders on the same bar for selecting max and min values. I have taken reference of the below link and I am using Point feedback slider.

https://www.cocoacontrols.com/controls/nmrangeslider

It comprises of:

  1. I added 2 buttons - add and substrate.
  2. click on add button the upper value increases by 1
  3. click on substrate button the upper value decreases by 1

Now what I need to do is:

  1. When I slide the left point from left to right the slider lower value and upper value should be increased by +1.
  2. when I slide the left point from left to right the slider lower value and upper value should be decreased by -1.

The purpose is to be able to move the sliders left and right in the fix intervals.

David Ansermot
  • 6,052
  • 8
  • 47
  • 82
sof question
  • 93
  • 2
  • 13

1 Answers1

0

inside - (void) updateSliderLabels;

add this line:

self.upperLabel.text = [NSString stringWithFormat:@"%d", (int)self.labelSlider.upperValue+(int)self.labelSlider.lowerValue];
Tanuj
  • 531
  • 4
  • 10
  • if you find any doubt plz let me know. – Tanuj Apr 20 '15 at 11:39
  • thanks but the problem is the label number is increasing but the but the slider remain contact the slider should also move to left and right as number increase and decrease – sof question Apr 20 '15 at 12:40
  • you need to add self.upperLabel.text = [NSString stringWithFormat:@"%d", (int)self.labelSlider.upperValue+(int)self.labelSlider.lowerValue]; at the bottom of code. – Tanuj Apr 20 '15 at 12:41
  • you need to slide your slider automatically with respect to value? – Tanuj Apr 20 '15 at 12:44
  • It is possible by using [setValue: animated:] method of UISlider. You can set the slider using this method. Get a sample project shared on Github https://github.com/domesticcatsoftware/DCFineTuneSlider. Hope it works for you. – Tanuj Apr 20 '15 at 13:19
  • I am trying to run this code but it is showing the error - you don't have permission – sof question Apr 20 '15 at 13:51
  • Change the value of "Compiler for C/C++/Objective-C" to Default Compiler under BUILD OPTIONS – Tanuj Apr 20 '15 at 13:56
  • can you please help me in solution this problem - http://stackoverflow.com/questions/29845085/how-to-add-different-color-in-a-ui-slider-in-ios – sof question Apr 24 '15 at 10:28