mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Fix media picker initial stick to bottom on iPad
This commit is contained in:
parent
95b425e168
commit
cd64a206b6
@ -264,6 +264,10 @@
|
|||||||
|
|
||||||
- (void)_adjustContentOffsetToBottom
|
- (void)_adjustContentOffsetToBottom
|
||||||
{
|
{
|
||||||
|
if (!self.isViewLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UIEdgeInsets contentInset = [self controllerInsetForInterfaceOrientation:self.interfaceOrientation];
|
UIEdgeInsets contentInset = [self controllerInsetForInterfaceOrientation:self.interfaceOrientation];
|
||||||
|
|
||||||
bool hasOnScreenNavigation = false;
|
bool hasOnScreenNavigation = false;
|
||||||
@ -308,6 +312,9 @@
|
|||||||
_collectionViewWidth = frame.size.width;
|
_collectionViewWidth = frame.size.width;
|
||||||
_collectionView.frame = frame;
|
_collectionView.frame = frame;
|
||||||
|
|
||||||
|
[_collectionView.collectionViewLayout invalidateLayout];
|
||||||
|
[_collectionView layoutSubviews];
|
||||||
|
|
||||||
if (lastInverseOffset < 45)
|
if (lastInverseOffset < 45)
|
||||||
{
|
{
|
||||||
[self _adjustContentOffsetToBottom];
|
[self _adjustContentOffsetToBottom];
|
||||||
@ -319,9 +326,6 @@
|
|||||||
CGPoint contentOffset = CGPointMake(0, -contentInset.top);
|
CGPoint contentOffset = CGPointMake(0, -contentInset.top);
|
||||||
[_collectionView setContentOffset:contentOffset animated:false];
|
[_collectionView setContentOffset:contentOffset animated:false];
|
||||||
}
|
}
|
||||||
|
|
||||||
[_collectionView.collectionViewLayout invalidateLayout];
|
|
||||||
[_collectionView layoutSubviews];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Gallery
|
#pragma mark - Gallery
|
||||||
|
Loading…
x
Reference in New Issue
Block a user