UIAlertView后台问题



我使用一个Uialertview在我的类。

我的代码

UIAlertView *alertView   = [[UIAlertView alloc]initWithTitle:nil message:@"message" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alertView show];

但是问题是当我按下ok按钮时,警报隐藏了,但是黑色背景仍然在那里。

有人知道这个问题的答案吗?

试试这个

 UIAlertView * alertView = [[[UIAlertView alloc] initWithTitle:@"" message:@"message" delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil, nil] autorelease];
 [alertView show];

在你的代码中[[UIAlertView alloc]initWithTitle:nil @"message" 应该 initWithTitle:@"message"

这样的喜欢,

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Your Title" message:@"Your Message Body !!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];

试试,

UIAlertView *alertView   = [[UIAlertView alloc]initWithTitle:@"" message:@"message" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alertView show];

最新更新