2016-06-21 8 views
0

enter image description hereUIImageはUIAlertActionに表示されていませんか?

私のコードのようです:

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]; 

答えて

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]; 
関連する問題