• iOS


    7、UIStepper

        //计数器控件   固定宽高

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

        [self.view addSubview:stepper];

        stepper.value = 30;

        stepper.minimumValue = 10;

        stepper.maximumValue = 50;

        stepper.stepValue = 2;

        stepper.continuous = NO;

        //临界是否继续输出,min <-> max

        stepper.wraps = YES;

        stepper.tintColor = [UIColor redColor];

        //点住按钮是否自动增加计数

        stepper.autorepeat = YES;   

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

    }

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

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

        self.stepperLabel.font = [UIFont systemFontOfSize:stepper.value];

    }

     
  • 相关阅读:
    11月28日总结
    12月06日总结
    12月02日总结
    11月26日总结
    12月05日总结
    11月30日总结
    软件设计职责链模式
    软件设计策略模式
    软件设计组合模式
    大数据竞赛练习题二
  • 原文地址:https://www.cnblogs.com/PSSSCode/p/5508439.html
Copyright © 2020-2023  润新知