Uistepper Stepper--event-driven controls (one + and-button)

Source: Internet
Author: User

-(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)

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.