0

在此处输入图像描述

我的代码是这样的:

UIImage *imk= [UIImage imageWithData:imageData];



    UIAlertController * alert=   [UIAlertController
                                  alertControllerWithTitle:@"Success"
                                  message:@"Posted Successfully."
                                  preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction *Action=[[UIAlertAction alloc]init];
    [Action setValue:imk forKey:@"image"];
    [alert addAction:Action];

            [self presentViewController:alert animated:YES completion:nil];
4

1 回答 1

0

这样做..它会有所帮助:

    UIAlertController * alert=   [UIAlertController
                                  alertControllerWithTitle:@"Success"
                                  message:@"Posted Successfully."
                                  preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* action = [UIAlertAction
                     actionWithTitle:@"Title"
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         [view dismissViewControllerAnimated:YES completion:nil];

                     }];
[action setValue:[[UIImage imageNamed:@"img.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[alert addAction:action];
[self presentViewController:alert animated:YES completion:nil];
于 2016-06-21T13:13:13.760 回答