January 2012
Beginner
655 pages
16h 35m
English
First, handle the Did End on Exit event (or implement the textFieldShouldReturn: method in the View Controller). Then call the resignFirstResponder method of the UITextField outlet to release its first-responder status.
Register for the notifications UIKeyboardDidShowNotification and UIKeyboardDidHideNotification.
NSDictionary* info = [notification userInfo]; //---obtain the size of the keyboard--- NSValue *aValue = [info objectForKey:UIKeyboardFrameEndUserInfoKey]; CGRect keyboardRect = [self.view convertRect:[aValue CGRectValue] fromView:nil]; NSLog(@“%f”, keyboardRect.size.height);
Use the UIScrollView to contain views so that the user can scroll through them. Then, set the new size of the scroll view:
- (void)viewDidLoad {
//---set this to the screen size---
scrollView.frame = CGRectMake(0, 0, 320, 460);
//---set this to the final size of the scroll view---
[scrollView setContentSize:CGSizeMake(320, 713)];
[super viewDidLoad];
}