Uistepper (add and subtract symbols) (step control)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.