Closed AlbertoMalavasi closed 5 years ago
Once the keyboard has been opened, the view's height increases to a specific number of points, but when I close the keyboard that views doesn't go back to its original (height) size.
My container view is made by several collection views and views containing labels. I'm using the keyboard avoiding scroll view class.
Have you solved your problem,I have the same problem
try this. func textFieldDidEndEditing(_ textField: UITextField, reason: UITextFieldDidEndEditingReason) {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1){[weak self] in
self?.scrollView.contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0);
}
}
NOT solved. still scroll :(
try this. func textFieldDidEndEditing(_ textField: UITextField, reason: UITextFieldDidEndEditingReason) {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1){[weak self] in self?.scrollView.contentInset = UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0); } }
Does anyone has solutions?
- (void)TPKeyboardAvoiding_keyboardWillHide:(NSNotification*)notification
CGRect keyboardRect = [self convertRect:[[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];
modified to
CGRect keyboardRect = [self convertRect:[[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue] fromView:nil];
Once the keyboard has been opened, the view's height increases to a specific number of points, but when I close the keyboard that views doesn't go back to its original (height) size.
My container view is made by several collection views and views containing labels. I'm using the keyboard avoiding scroll view class.