2013-03-13 49 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]; 
}