Basic Control-uislider (slider)
Create a slider view to determine its position and size (height can be ignored)
UISlider *slider = [[UISlider alloc] Initwithframe:cgrectmake (50, 100, 200, 0.0)];
Set the range and default value of the slider
Slider.minimumvalue = 0.0;//Maximum Value
Slider.maximumvalue = 50.0;//Minimum value
Set a default value for the slider
Slider.value = 22.0;
slider.continuous = YES;
Set the background color of the slider
Slider.backgroundcolor = [Uicolor Redcolor];
Setting up Response Events
[Slider addtarget:self action: @selector (sliderchanged:) forcontrolevents:uicontroleventeditingchanged];
[Self.view Addsubview:slider];
Base control-uiswitch (switch)
Uiswitch *st = [[Uiswitch alloc] Initwithframe:cgrectmake (100.0F, 20.0F)];
Setting the initialization state of Uiswitch
st.on=yes;//set the side of the initial no
The color at which switch is on
St.ontintcolor = [Uicolor Purplecolor];
The color of switch when off
St.tintcolor = [Uicolor Yellowcolor];
Set the on icon
St.onimage = [UIImage imagenamed:@ "Ondemo"];
Set the on icon
St.offimage = [UIImage imagenamed:@ "Startdemo"];
Set the color of your thumb
St.thumbtintcolor = [Uicolor Greencolor];
Setting the initialization state of Uiswitch
[Self.view addsubview:st];
Step-by-step learning about the properties of iOS (UISlider and Uiswitch)