-
- (void)viewDidLoad
{
[ [[ selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotifi cation object:nil]; [[ selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotifi cation object:nil]; }
// Called when the keyboard appears or changes
- (void)keyboardWillShow:(NSNotification *)aNotification
{
NSDictionary *userInfo = [aNotification userInfo]; foKey ]; CGRect keyboardRect = [aValue CGRectValue]; float height = keyboardRect.size.height; }
// Called when the key exits
- (void)keyboardWillHide:(NSNotification *)aNotification
{
}
iOS get height of keyboard (notify changes when keyboard appears, changes and disappears)
Guess you like
Origin blog.csdn.net/lichuanliangios/article/details/46044643
Ranking