UIStepper音量调节控件

来源:互联网 发布:网上模拟钢琴软件 编辑:程序博客网 时间:2024/05/17 02:18

UIStepper *stepper = [[UIStepper allocinitWithFrame:CGRectMake(10020000)];

    stepper.minimumValue = 30;

    stepper.maximumValue = 10;

    stepper.value = 20;

    stepper.stepValue = 2;

    // 是否循环

    stepper.wraps = YES;

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

    stepper.tag = 10;

    [self.view addSubview:stepper];

    [stepper release];

}


- (void)stepperAction:(id)stepper

{

    UIStepper *ste = (UIStepper *)[self.view viewWithTag:10];

    int a = ste.value;

    NSLog(@"%d",a);

}

运行效果:


0 0
原创粉丝点击