2014-10-08 67 views
0

我正在使用一個具有大量警報視圖的舊應用程序。此應用程序在iOS7中工作正常,但在iOS8中警報視圖按鈕文本顏色變白並且不可見。功能明智,它也在iOS8中工作。 請參閱屏幕截圖瞭解更多信息。 enter image description hereiOS 8中的UIAlertView按鈕標題變白白

+0

你定製UIAlerView的按鈕? – 2014-10-08 07:13:21

+0

沒有..它的標準UIAlertView。 – Deepak 2014-10-08 07:16:43

+0

你可以在這裏粘貼代碼嗎? – 2014-10-08 07:21:32

回答

1

你試試這個代碼

- (void)viewDidLoad { 
     [super viewDidLoad]; 
     // Do any additional setup after loading the view from its nib. 

     UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Alrt" message:@"This is the Message" preferredStyle:UIAlertControllerStyleAlert]; 
     UIAlertAction *cancelAction = [UIAlertAction 
             actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel action") 
             style:UIAlertActionStyleCancel 
             handler:^(UIAlertAction *action) 
             { 
              NSLog(@"Cancel action"); 
             }]; 

     UIAlertAction *okAction = [UIAlertAction 
            actionWithTitle:NSLocalizedString(@"OK", @"OK action") 
            style:UIAlertActionStyleDefault 
            handler:^(UIAlertAction *action) 
            { 
             NSLog(@"OK action"); 
            }]; 

     [alertController addAction:cancelAction]; 
     [alertController addAction:okAction]; 

     [self presentViewController:alertController animated:YES completion:nil]; 
    } 

enter image description here

+0

但它可從iOS8獲得。 – 2014-10-08 07:24:02

+0

我知道與UIAlertController,但我只想文本顏色問題。這個問題只發生在iOS8中。 – Deepak 2014-10-08 07:25:07

+0

您需要哪種顏色 – 2014-10-08 07:34:25