首页 > 其他 > 详细

UIStepper

时间:2015-08-27 00:08:53      阅读:149      评论:0      收藏:0      [点我收藏+]

这个也是很简单的控件,下面是一些用法

 

    UIStepper *steper = [[UIStepper alloc] initWithFrame:CGRectMake(50, 50, 100, 100)];

    [self.view addSubview:steper];

    steper.tag = 100;

// 设置最值

    steper.minimumValue = 1;

    steper.maximumValue = 30;

   

    steper.stepValue = 2; // 每次递增2

    steper.value = 10;// 初值为10

    [steper setWraps:YES];// 是否循环

    

    [steper addTarget:self action:@selector(change:) forControlEvents:UIControlEventValueChanged];

    [steper release];

 

 

- (void)change:(UIStepper *)stepper{

// 判断stepper 是否连续,用continuous

    if (stepper.continuous) {

      // steper.value 是取出当前值

        NSLog(@"%f", stepper.value);

    }else{

        NSLog(@"jian");

    }

}

UIStepper

原文:http://www.cnblogs.com/qiushifalife/p/4761980.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!