// UIStepper的常用方法
UIStepper *oneStepper = [[UIStepper alloc] init];
oneStepper.frame = CGRectMake(20, 20, 20, 20);
oneStepper.backgroundColor = [UIColor blueColor]; // 设置背景色
oneStepper.tintColor = [UIColor yellowColor]; // 设置按钮的颜色
oneStepper.alpha = 1.0; // 设置透明度 范围0.0-1.0之间
oneStepper.value = 12.0f; // 设置初始值
oneStepper.minimumValue = 10; // 设置最小值,默认是0
oneStepper.maximumValue = 20; // 设置最大值,默认是100
oneStepper.stepValue = 2; // 每点击一次增加或减少的值,默认是1
[oneStepper setBackgroundImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal]; // 设置不同状态显示不的不同背景图片
[oneStepper addTarget:self action:@selector(oneStepperValueChanged:) forControlEvents:UIControlEventValueChanged]; // 添加监听方法
// 添加到View,并释放内存
[self.view addSubview:oneStepper];
[oneStepper release], oneStepper = nil;