How to put UISlider vertical?

MD. picture MD. · Mar 4, 2010 · Viewed 25k times · Source

I want to put UISlider in vertically. I have no idea about this, so please help me for this.

Answer

ravinsp picture ravinsp · Mar 4, 2010

You have to do this programaticaly. Assuming your UISlider is bound to a variable called slider, add this code in your viewDidLoad method in ViewController.m:

- (void)viewDidLoad {

    [super viewDidLoad];

    CGAffineTransform trans = CGAffineTransformMakeRotation(M_PI * 0.5);
    slider.transform = trans;
}

Let me know if you need any more help on this..