Update bottomSpacer when keyboard hides.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2021-02-05 13:48:13 +01:00
Родитель 3443d05285
Коммит bf53d429db
1 изменённых файлов: 27 добавлений и 17 удалений

Просмотреть файл

@ -146,11 +146,8 @@
NSBundle *bundle = [NSBundle bundleForClass:[ShareConfirmationCollectionViewCell class]];
[self.shareCollectionView registerNib:[UINib nibWithNibName:kShareConfirmationTableCellNibName bundle:bundle] forCellWithReuseIdentifier:kShareConfirmationCellIdentifier];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
_type = ShareConfirmationTypeItem;
}
@ -185,6 +182,11 @@
}];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma mark - Button Actions
- (void)cancelButtonPressed
@ -593,6 +595,14 @@
}];
}
-(void)keyboardDidHide:(NSNotification *)notification
{
[UIView animateWithDuration:0.3 animations:^{
self.bottomSpacer.constant = 0;
[self.view layoutIfNeeded];
}];
}
- (void)updateToolbarForCurrentItem
{
ShareItem *item = [self getCurrentShareItem];