2013-03-13 67 views

回答

2

实施UIKeyboardDidShowNotificationUIKeyboardWillHideNotification,所以你可以做的Web视图复位。

实施例:

- (void)viewDidLoad 
{ 

    [[NSNotificationCenter defaultCenter] addObserver:self 
               selector:@selector(keyboardWasShown:) 
                name:UIKeyboardDidShowNotification 
                object:nil]; 

    [[NSNotificationCenter defaultCenter] addObserver:self 
               selector:@selector(keyboardWillHide:) 
                name:UIKeyboardWillHideNotification 
                object:nil]; 

} 


- (void)keyboardWasShown:(NSNotification *)notification 
{ 
    //align Web-view here 
} 
- (void)keyboardWillHide:(NSNotification *)notification 
{ 
    //align Web-view here 
} 

- (void)viewDidUnload 
{ 
    [[NSNotificationCenter defaultCenter] removeObserver:self]; 
}