您的位置:首页 > 产品设计 > UI/UE

UIStepper

2015-08-08 21:09 309 查看
1.创建对象

UIStepper *stepper = [[UIStepper alloc]initWithFrame:CGRectMake(100, 400, 100, 30)];


2.设置背景颜色

stepper.backgroundColor=[UIColor blueColor];


3.自定义触发事件

[stepper addTarget:self action:@selector(stepAction:) forControlEvents:UIControlEventValueChanged];


4.设置最小值

[stepper setMinimumValue:0];


5.设置最大值

[stepper setMaximumValue:100];


6.设置递增量

stepper.stepValue=20;


7.设置循环

[stepper setWraps:YES];


8.设置连续递加减

[stepper setContinuous:YES];


9.添加视图上

[self.imageView addSubview:stepper];


10.释放

[stepper release];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: