How to place UIStepper vertically?

1.5k views Asked by At

I am developing a products storage app and need to implement a UIStepper in it. The problem is that I just can't place it vertically as I would like to have it.

So does anyone know a way I can do this??

1

There are 1 answers

4
Firo On

You should be able to modify the transform:

stepper.transform = CGAffineTransformMakeRotation(M_PI / 2.0);

Edit:

I now see that this is problematic for IB. I often create my views programmatically and this does not seem to be an issue:

UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(150, 150, 27, 94)];

// this doesn't even have a problem:
UIStepper *stepper = [[UIStepper alloc] init];

It only seems to be an issue with IB. Setting the frame after the fact also does not seem to help.