Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Wrong bubble width on iPad, iOS 9 #1212

Closed
oanaBan opened this issue Sep 21, 2015 · 3 comments · Fixed by #1238
Closed

Wrong bubble width on iPad, iOS 9 #1212

oanaBan opened this issue Sep 21, 2015 · 3 comments · Fixed by #1238
Labels
Milestone

Comments

@oanaBan
Copy link

oanaBan commented Sep 21, 2015

When accessing Messages room with storyboard on iPad with iOS 9 (on both latest version of master branch and develop branch) the bubble width is wrong. Pls see the attached image.
simulator screen shot 21 sep 2015 12 25 54

This is not repro on iOS 8.

@harlanhaskins
Copy link
Collaborator

I've noticed this in some weird cases, too. Are there any constraint errors that pop up when this happens?

@Yostra
Copy link

Yostra commented Sep 21, 2015

when you go to split view on iPad air 2, same thing happens

@jessesquires jessesquires added this to the 7.2.1 milestone Sep 25, 2015
@harlanhaskins
Copy link
Collaborator

Looking at this now, we really should respond to -[UIViewController viewWillTransitionToSize:withTransitionCoordinator:] and -[UIViewController traitCollectionDidChange:].

This makes the split screen multitasking work nicely:

- (void)resetLayoutAndCaches {
    JSQMessagesCollectionViewFlowLayoutInvalidationContext *context = [JSQMessagesCollectionViewFlowLayoutInvalidationContext context];
    context.invalidateFlowLayoutMessagesCache = YES;
    [self.collectionView.collectionViewLayout invalidateLayoutWithContext:context];
}
-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
    [self resetLayoutAndCaches];
}

- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
    [super traitCollectionDidChange:previousTraitCollection];
    [self resetLayoutAndCaches];
}

PR Incoming! @jessesquires.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants