Search code examples
iphonecocoa-touchuialertviewappstore-approval

How to customize UIAlertView? Will Apple approve it?


I am using a custom UIAlertView with UITextField to get password from the user.

I have been told that this custom view may cause my App to get reject by Apple; is that correct? If so, what is the appropriate replacement for my custom control?


Solution

  • You can add a textfield to your UIAlertView

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"msg" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil];
    UITextField *txtField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
    [alertView addSubview:txtField];
    [alertView show];
    [alertView release];