Guest User

Untitled

a guest
May 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)keyboardWasShown:(NSNotification*)aNotification
  2. {
  3.     NSLog(@"%@",NSStringFromSelector(_cmd));
  4.     NSDictionary *info = [aNotification userInfo];
  5.     CGSize kbSize = [[info objectForKey: UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
  6.     NSLog(@"keyboard width: %.f keyboard height:  %.f ",kbSize.width, kbSize.height);
  7.     UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0);
  8.     self.myScroll.contentInset = contentInsets;
  9.     self.myScroll.scrollIndicatorInsets = contentInsets;
  10.    
  11.     CGRect aRect = self.view.frame;
  12.     aRect.size.height -= kbSize.height;
  13.    
  14.    
  15. //    if (!CGRectContainsPoint(aRect, self.contactTextView.frame.origin)) {
  16.         CGPoint scrollPoint = CGPointMake(0.0, self.contactTextView.frame.origin.y - kbSize.height);
  17.  
  18.         [self.myScroll setContentOffset:scrollPoint animated:YES];
  19.     NSLog(@"%.f",self.myScroll.contentOffset.y);
  20. //    }
  21. }
Add Comment
Please, Sign In to add comment