Is it possible to set up UISwitches and UISliders vertically rather than horizontally?
As like Caleb said, it may violate the guideline.But am not sure about that.
If you really want to change the here is a sample ,
urSlider.transform=CGAffineTransformRotate(urSlider.transform,270.0/180*M_PI);
The above code will change the slider position from horizontal to vertical.Same like this you can do for UISwitch.
I am looking to do the same. From the Apple Developer Site iOS UI Element Usage Guidelines:
Slider
Appearance and Behavior
A slider consists of a track and a thumb (a circular control that the user can slide) and optional images that convey the meaning of the right and left values. When people drag the thumb along the slider, the value or process is updated continuously and is displayed in the track.
Guidelines
Use a slider to give users fine-grained control over values they can choose or the operation of the current process.
If appropriate, customize the appearance of a slider. For example, you can do any of the following:
Display a slider either horizontally or vertically.
Set the width of a slider to fit in with the UI of your app.
Define the appearance of the thumb, so that users can see at a glance whether the slider is active.
Supply images to appear at both ends of the slider to help users understand what the slider does.Typically, these custom images correspond to the minimum and maximum values of the value range that the slider controls. A slider that controls font size, for example, could display a very small character at the minimum end and a very large character at the maximum end.
Define a different appearance for the track, depending on which side of the thumb it is on and which state the control is in.
There do not seem to be prohibitions against changing switches, steppers, and segmented controls. However, permission does not appear to be explicitly granted for those controls.
While it's not a good idea to modify the standard iOS controls like UISlider or UISwitch, it's very easy to write your own custom UIControl. See Mike Ash's "Diagonal Slider" post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With