-(void) Viewdidload {
[Super Viewdidload];
SELF.SP = [[Uistepper alloc]init];
Set the position of the pedometer
Self.sp.center = cgpointmake (100, 100);
Pedometer minimum and maximum values
Self.sp.minimumValue = 0;
Self.sp.maximumValue = 10;
Set step step value for pedometer
Self.sp.stepValue = 1.0;
Do you press the constant change value
Self.sp.autorepeat = YES;
Add a Click event
[Self.sp addtarget:self Action: @selector (ValueChange:) forcontrolevents:uicontroleventtouchupinside];
[Self.view ADDSUBVIEW:SELF.SP];
Setting the slider
SELF.SD = [[UISlider alloc]init];
Self.sd.center = Cgpointmake (200, 300);
Self.sd.maximumValue = 100;
Self.sd.minimumValue = 10;
Style on both sides of the slider
Self.sd.minimumTrackTintColor = [Uicolor Redcolor];
Self.sd.maximumTrackTintColor = [Uicolor Bluecolor];
You can set the picture on both sides
Self.sd.minimumValueImage = [UIImage imagenamed:@ ""];
Self.sd.maximumValueImage = [UIImage imagenamed:@ ""];
Adding sliding events
[Self.sd addtarget:self Action: @selector (ValueChange1:) forcontrolevents:uicontroleventtouchupinside];
[Self.view ADDSUBVIEW:SELF.SD];
}
is a change in value
-(void) ValueChange: (uistepper*) sp{
NSLog (@ "%f", Sp.value);
}
-(void) ValueChange1: (uislider*) sd{
NSLog (@ "%f", Sd.value);
}
#pragma mark-Switch space properties and on and off
-(void) switchvaluechanged: (Uiswitch *) SW
{
if (Sw.on)
{
NSLog (@ "open");
}
Else
{
NSLog (@ "off");
}
iOS notes Uikit_uislider/uistepper/uiswitch