Vertical slider - adapt size

Asked

Viewed 55 times

0

I need some sliders placed via storyboard to adapt to the screen size when placed upright.

For example I put three sliders on the screen and put your contraints so that they have the same width and stay at 20 px equidistant, they are also 20 px from each edge of the screen. They stayed that way:

inserir a descrição da imagem aqui

To stay upright I used Cgaffinetransformmakerotation this way for each one:

@IBOutlet var slider01: UISlider! {
        didSet{
            slider01.transform = CGAffineTransformMakeRotation(CGFloat(-M_PI_2))
        }
    }

After running this application the screen stays this way:

inserir a descrição da imagem aqui

However I would like the sliders to be 20 px from the top and bottom edges, so:

inserir a descrição da imagem aqui

Any suggestions?

  • Already solved? In the last two sliders you set for them to have the same width of the first.. but you set the width of the first to a certain value?

  • The width of the first slider is automatic because of the other constraints already defined.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.