Following is the code I am using to create an AlertView. But the Ok button is not visible.
UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Reset Password"
message:@"\n\n" // IMPORTANT
delegate:self
cancelButtonTitle:nil
otherButtonTitles:OTHER_BUTTON_OK, nil];
prompt.tag=RESET_PASSWORD;
txtOldPwd = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 50.0, 260.0, 25.0)];
[txtOldPwd setBackgroundColor:[UIColor whiteColor]];
[txtOldPwd setPlaceholder:@"Old Password"];
txtOldPwd.text=@"";
[prompt addSubview:txtOldPwd];
[txtOldPwd release];
txtNewPwd = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 80.0, 260.0, 25.0)];
[txtNewPwd setBackgroundColor:[UIColor whiteColor]];
[txtNewPwd setPlaceholder:@"New Password"];
txtNewPwd.text=@"";
[prompt addSubview:txtNewPwd];
[txtNewPwd release];
txtConfirmPwd = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 110.0, 260.0, 25.0)];
[txtConfirmPwd setBackgroundColor:[UIColor whiteColor]];
[txtConfirmPwd setPlaceholder:@"Confirm Password"];
txtConfirmPwd.text=@"";
[prompt addSubview:txtConfirmPwd];
[txtConfirmPwd release];
[prompt show];
[prompt release];
I am adding a screenshot of what I am getting.
Update
I just discovered that button is actually there. Height of Alert is too less. A very little portion of button is visible. I tried this approach but the button is still not visible. Although the height of alert increases.
increase the \n ok