Попробуй это.Сначала сделайте свое текстовое поле скрытым на viewdidload - затем нажмите кнопку, затемните его ... сделайте его редактируемым и откройте клавиатуру для пользователя.
//viewDidLoad
yourTextField.alpha = 0;
yourTextField.userInteractionEnabled = FALSE;
-(void)editNote {
//fade in text field after button push
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelay:0];
[UIView setAnimationDuration:0.75];
yourTextField.alpha = 1;
[UIView commitAnimations];
//make text field editable
yourTextField.userInteractionEnabled = TRUE;
//pop up keyboard
[yourTextField becomeFirstResponder];
}
------- Update --------
Теперь, когда вы описали, что вы пытаетесь сделать немного лучше.Вы захотите создать совершенно новый ViewController с полями (UITextFields и т. Д.) В этом новом контроллере представления.
На нажатие кнопки вы будете код:
TextFieldViewController * vc = [(TextFieldViewController *)[[TextFieldViewController alloc] init] autorelease];
[self.navigationController presentModalViewController:vc animated:YES];
[vc release];
//you will need to create a button on this new ViewController and use this code to dismiss it when done.
[[self parentViewController] dismissModalViewControllerAnimated:YES];