iOS Uistepper controls

Source: Internet
Author: User

A new digital input control Uistepper has been added to the iOS5, which can be entered in progressive quantities . Uistepper inherits from Uicontrol, and its main event is uicontroleventvaluechanged, which triggers this event whenever its value changes. It shows the following effects:

It mainly has the following properties

    • Value currently represented by default 0.0
    • MinimumValue minimum value that can be represented, default 0.0
    • MaximumValue The maximum value that can be represented, default 100.0
    • Stepvalue each increment or decrement of value, default 1.0

Set the above values, it is generally easy to use.

1234567 UIStepper *stepper = [[UIStepper alloc] init];stepper.minimumValue = 2;stepper.maximumValue = 5;stepper.stepValue = 2;stepper.value = 3;stepper.center = CGPointMake(160, 240);[stepper addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];

Note: Above I set Stepvalue is 2, the current value is 3, the minimum value is 2. But if we click on "-", this is value will become 2 instead of 1. That is, each change is value±stepvalue, and then the final value is limited to the [Minimumvalue,maximumvalue] range.

There are several other control properties:

    • Continuous controls whether the Uicontroleventvaluechanged event is continuously triggered. The default yes, which triggers the uicontroleventvaluechanged event every time a value change is pressed, or the Uicontroleventvaluechanged event is triggered only when the button is released.
    • AutoRepeat controls whether or not the hold is automatically continuously incremented or decremented. Default yes.
    • Wraps whether the control value loops within the [Minimumvalue,maximumvalue] interval. default No, when the maximum or minimum is reached, the button disable.

These control attributes are used only in special cases and are generally used with default values

iOS Uistepper controls

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.