UI_UIStepper control, uistepper
# Pragma mark-create control UIStepper-(void) createSteppper {UIStepper * stepper = [[UIStepper alloc] initWithFrame: CGRectMake (130,150, 50, 20)]; // set the minimum stepper value, the default value is 0 stepper. minimumValue = 20; // sets the maximum value of stepper. The default value is 100 stepper. maximumValue = 120; // you can specify the number of stepper added or subtracted each time. stepValue = 10; // set the default value of the current stepper step. value = 50; [self addSubview: stepper]; [stepper release]; // bind the click event [stepper addTarget: self action: @ selector (stepperAction :) forControlEvents: UIControlEventValueChanged];} -(void) stepperAction :( UIStepper *) sender {NSLog (@ "stepper"); self. view. frame = CGRectMake (self. view. frame. origin. x, self. view. frame. origin. y, self. view. frame. size. width, sender. value); // self. view. frame = CGRectMake (50,150, self. frame. size. width, sender. value );}
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.