zoukankan      html  css  js  c++  java
  • UIStepper

     

    UIStepper

    分类: IOS
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        
        UIStepper *stepper = [[UIStepper alloc] init];
        stepper.tag = 10;
        stepper.center = CGPointMake(160, 240);
        stepper.minimumValue = 1; //设置最小值
        stepper.maximumValue = 30; //设置最大值
        stepper.stepValue = 2; //每次递增2
        stepper.value = 15; //初始值
        [stepper setWraps:YES]; //是否循环
        [stepper addTarget:self action:@selector(doTest) forControlEvents:UIControlEventValueChanged];
        
        
        [self.view addSubview:stepper];
        [stepper release];

    }

    -(void)doTest
    {
        UIStepper *per = (UIStepper*)[self.view viewWithTag:10];
        
        if (per.continuous)
        {
            NSLog(@"Y");
            int a = per.value;  //获取当前值
            NSLog(@"%d", a);
        }
        else 
        {
            NSLog(@"N");
        }
    }
  • 相关阅读:
    CSS3中制作倒影box-reflect
    JS中==与===区别
    CSS3-Animation
    CSS3-transform
    CSS3-transition
    CSS盒模型-box-sizing
    css兼容处理-hack
    CSS3-rgba
    CSS3-文本-word-wrap,word-break,white-space
    CSS3-文本-text-shadow
  • 原文地址:https://www.cnblogs.com/iOS-mt/p/4143682.html
Copyright © 2011-2022 走看看