Thanks to visit codestin.com
Credit goes to github.com

Skip to content

rsimenok/RSSliderView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RSSliderView

RSSliderView is a simple control for IOS based on UIView Class.

Here a preview:

A preview of this control

To create slider just do:

RSSliderView *horSlider = [[RSSliderView alloc] initWithFrame:CGRectMake(40, 40, 300, 80) andOrientation:Horizontal];
horSlider.delegate = self;
[horSlider setColorsForBackground:[UIColor colorWithRed:27.0/255.0 green:28.0/255.0 blue:37.0/255.0 alpha:1.0]
                       foreground:[UIColor colorWithRed:0.0 green:106.0/255.0 blue:95.0/255.0 alpha:1.0]
                           handle:[UIColor colorWithRed:0.0 green:205.0/255.0 blue:184.0/255.0 alpha:1.0]
                           border:[UIColor colorWithRed:0.0 green:205.0/255.0 blue:184.0/255.0 alpha:1.0]];
horSlider.label.text = @"Horizontal slider";
horSlider.label.font = [UIFont fontWithName:@"Helvetica" size:25];
horSlider.label.textColor = [UIColor colorWithRed:0.0 green:205.0/255.0 blue:184.0/255.0 alpha:1.0];
[self.view addSubview:horSlider];

after you set delegate you can get values from slider

-(void)sliderValueChanged:(RSSliderView *)sender {
    NSLog(@"Value Changed: %f", sender.value);
}

-(void)sliderValueChangeEnded:(RSSliderView *)sender {
    NSLog(@"Touch ended: %f", sender.value);
}

If you don't need handle

    [mySlider hideHandle];

If you don't like round corners or border

	[mySlider removeRoundCorners:YES removeBorder:YES];

License

RSSliderView is licensed under the terms of the MIT license. Please see the LICENSE file for full details.

About

Custom slider based on UIView for iOS

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •