-(void) Viewdidload {
[Super Viewdidload];
Stepper fixed size (94*27), event-driven control
Uistepper *st = [[Uistepper alloc] Initwithframe:cgrectmake (10,10,300,30)];
Set the maximum value
St.maximumvalue = 300;
Set minimum value
St.minimumvalue = 10;
Set the step size (the default value is 1 must >0) (+ once increased value/-once reduced value)
St.stepvalue = 10;
st.continuous = NO;
[St Addtarget:self Action: @selector (steppervaluechanged:) forcontrolevents:uicontroleventvaluechanged];
[Self.view addsubview:st];
Progress bar, normal view control, height fixed 9
Uiprogressview *progress = [[Uiprogressview alloc] Initwithframe:cgrectmake (10,100,300,30)];
Progress property of progress bar (default = 0,0.0-1.0), value greater than 1, progress bar always in full state
Progress.progress = 0.1;
Progress.tag = 101;
[Self.view addsubview:progress];
}
-(void) steppervaluechanged: (Uistepper *) st{
Click the +/-number value to change
Uiprogressview *progress = (Uiprogressview *) [Self.view viewwithtag:101];
progress.progress = st.value/300;
NSLog (@ "steppervalue:%f", St.value);
}
Uistepper Stepper--event-driven controls (one + and-button)