TextField Covering UIAlertView's Button.
- by XcodeDev
Hi,
I am using a UIAlertView with three buttons: "Dismiss", "Submit Score" and @"View Leaderboard". The UIAlertView also contains a UITextField called username. At the moment the UITextField "username" is covering one of the buttons in the UIAlertView. I just wanted to know how I could stop the UITextField from covering one of the buttons, i.e move the buttons down.
Here is an image of what is happening:
And here is my code:
[username setBackgroundColor:[UIColor whiteColor]];
[username setBorderStyle:UITextBorderStyleRoundRect];
username.backgroundColor = [UIColor clearColor];
username.returnKeyType = UIReturnKeyDone;
username.keyboardAppearance = UIKeyboardAppearanceAlert;
username.placeholder = @"Enter your name here";
username = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
username.borderStyle = UITextBorderStyleRoundedRect;
[username resignFirstResponder];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Congratulations"
message:[NSString stringWithFormat:@"You tapped %i times in %i seconds!\n", tapAmount, originalCountdownTime]
delegate:self
cancelButtonTitle:@"Dismiss"
otherButtonTitles:@"Submit To High Score Leaderboard", @"View Leaderboard", nil];
alert.tag = 01;
[alert addSubview:username];
[alert show];
[alert release];