Rahul Nair
Rahul Nair

Reputation: 381

UIAlertView Background issue?

I Using a Uialertview in my class.

Here is my code

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

But the problem is when I press the ok button, the alert hides, but the black background is still there.

Does anyone have the answer for this?

Upvotes: 0

Views: 318

Answers (3)

Girish
Girish

Reputation: 4712

Try,

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

Upvotes: 0

Bhavin_m
Bhavin_m

Reputation: 2784

Try this.

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

Upvotes: 1

iPatel
iPatel

Reputation: 47069

In Your Code [[UIAlertView alloc]initWithTitle:nil @"message" should initWithTitle:@"message"

Such Like,

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

Upvotes: 0

Related Questions