Check it out first.
Create a stepper and a click Method
Original code:
UIStepper *stepper =[[UIStepperinitWithFrame:CGRectMake(50404040addTarget:selfaction:@selector(stepperClick:forControlEvents:UIControlEventValueChanged]; [selfaddSubview:stepper]; [stepper release];
Create a TextField to receive the display stepping value
Original code:
UITextField *textfield =[[UITextField alloc] initWithFrame:CGRectMake(200404030)]; textfield.layer.borderWidth =1; [self.view addSubview:textfield]; textfield.tag=1000; [textfield release];
Some settings and methods of Uistepper
1. Minimum step value :( default value is 0) [stepper setminimumvalue:0] ; 2. Max step :( default value is $) [stepper setmaximumvalue : +] ; 3. Whether to cycle (the default value is no ) [stepper Setwraps:yes] ; 4. The value of each step [stepper setstepvalue:1] ; 5. Control whether to automatically continuously increment or decrement when pressed, default yes [stepper setautorepeat: YES] ; 6. Controls whether the uicontroleventvaluechanged event is continuously triggered. The default is yes , that is, when you press and hold, each value change is triggered once uicontrol eventvaluechange event, otherwise the uicontroleventvaluechanged event is triggered only when released. [stepper Setcontinuous:yes] ;
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Uistepper (add and subtract symbols) (step control)