Search code examples
iphoneobjective-cios6

Uistepper in Uialertview


How can I show UIStepper in UIAlertView? Also suggest me any other alternative to show UIStepper in pop-up.


Solution

  • A better way of inserting views in UIAlertView would be to add them as a subview

    Try the following

    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:@"\n\n" delegate:nil  cancelButtonTitle:@"OK" otherButtonTitles: nil];
        UIStepper* stepper = [[UIStepper alloc] init];
        stepper.frame = CGRectMake(12.0, 5.0, 100, 10);
        [alert addSubview:stepper];
        [alert show];