-
Notifications
You must be signed in to change notification settings - Fork 0
How to use
Welcome to the NMRangeSlider wiki!
How to add a slider in our project ? Place a view in the design and set a class for that view as NMRangeSlider using identity Inspecter and in custom class set class as NMRangeSlider.And then make a property for that view.
@property (strong, nonatomic) IBOutlet NMRangeSlider *Range_Slider_View;
and in view didload customize the slider based on this method and call that method as [self configureRangeSlider];
#pragma mark - Metal Theme Slider
-
(void) configureThemeForRangeSlider:(NMRangeSlider*) slider { UIImage* image = nil;
image = [UIImage imageNamed:@"slider-metal-trackBackground"]; image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(0.0, 5.0, 0.0, 5.0)]; slider.trackBackgroundImage = image;
image = [UIImage imageNamed:@"slider-metal-track"]; image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(0.0, 7.0, 0.0, 7.0)]; slider.trackImage = image;
image = [UIImage imageNamed:@"slider-metal-handle"]; slider.lowerHandleImageNormal = image; slider.upperHandleImageNormal = image;
image = [UIImage imageNamed:@"slider-metal-handle-highlighted"]; slider.lowerHandleImageHighlighted = image; slider.upperHandleImageHighlighted = image; }
-
(void) configureRangeSlider { [self configureThemeForRangeSlider:Range_Slider_View]; Range_Slider_View.delegate=self; Range_Slider_View.backgroundColor=[UIColor clearColor]; Range_Slider_View.lowerValue = 100; Range_Slider_View.upperValue = 1000000; Range_Slider_View.minimumValue=100; Range_Slider_View.maximumValue=100000; }
#Delegate method:
-(void)onValueChangeForSlider:(UIControl *)slider inValue:(float)value { if(slider==Range_Slider_View) NSLog(@"%f",value); }