Tutorial details

Custom Sliders | App Code for Sale | Preview

Custom Sliders | iOS Tutorial

How to create custom sliders in xcode

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcodecustomslider.htm

In this tutorial i will be showing you how to create custom sliders in xcode

Features:

  • 1 UISlider

Sliders are used to adjust the value of an object and xcode enables you to create custom colour of the slider in the interface builder but int he tutorial i show you how to add custom images to the slider to enable you to create slider unique to your app

ViewController.h PAGE TOP

@interface ViewController :UIViewController {
IBOutlet UISlider *slider;
}
@end

ViewController.m PAGE TOP

@implementation ViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
UIImage *minImage = [UIImage imageNamed:@"leftbar.png"];
UIImage *maxImage = [UIImage imageNamed:@"rightbar.png"];
UIImage *thumbImage = [UIImage imageNamed:@"Button.png"];
    minImage = [minImage stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
    maxImage = [maxImage stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
    [slider setMinimumTrackImage:minImage forState:UIControlStateNormal];
    [slider setMaximumTrackImage:maxImage forState:UIControlStateNormal];
    [slider setThumbImage:thumbImage forState:UIControlStateNormal];
    minImage = nil;
    maxImage = nil;
    thumbImage = nil;
// Do any additional setup after loading the view, typically from a nib.
}
@end

Reference PAGE TOP

http://www.geekylemon.com/WEBPROTECT-xcodecustomslider.htm

0 Comments Leave a comment

Please login in order to leave a comment.

Newest first
!

Sign-in to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.