Is there any way to add UIPickerView into UIAlertController (Alert or ActionSheet) in Swift?

后端 未结 11 1337
旧巷少年郎
旧巷少年郎 2020-12-01 06:16

I\'m totally new to swift (and iOS programming at all), but I started messing around with it (it wasn\'t a good idea when everything is still beta version :D). So I tried to

11条回答
  •  孤城傲影
    2020-12-01 06:59

    Try this I done some trick...

    Below code is working for me in iPod iOS8beta5 + XCode6
    I add UIActivityIndicatorView control in UIAlertController in objective-c.

    UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil
                                            message:@"Please wait\n\n\n"
                                     preferredStyle:UIAlertControllerStyleAlert];
    
        UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
        spinner.center = CGPointMake(130.5, 65.5);
        spinner.color = [UIColor blackColor];
        [spinner startAnimating];
        [alert.view addSubview:spinner];
        [self presentViewController:alert animated:NO completion:nil];
    

    enter image description here


    Note :
    It's in objective-c but by this it's prove that we can also do this using swift.

提交回复
热议问题