New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content rescaling on layout (orientation) change #26
Conversation
Hey, thanks for the pull-request! Taking a look at this now. |
This is great, just tried it out on the Venmo app. Thanks again for the pull-request! 🍏 |
Content rescaling on layout (orientation) change
Just released a new version on CocoaPods (v2.2.2) with this change. 👍 |
Cool, thank you! |
{ | ||
[super layoutSubviews]; | ||
self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.frame) - self.horizontalInset * 2, CGRectGetHeight(self.frame) - self.verticalInset * 2); | ||
[self reloadData]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding that in my app, with this change we're running into issues where the token field can't be collapsed. I was seeing this in the example app too. The inputTextField now gets stuck in a state where it will not yield first responder. I'll investigate more into exactly why this seems to be an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't dive into the deep but I think this related to the reloadData call in layoutSubviews. It's a little bit unlucky way to force to update just the subviews layout because it is actually recreates the whole thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been looking at it a little bit myself, and it's definitely in [self reloadData]. I ran into a similar issue before so I'll see if I can figure it out here
Hi, Thanks for the great work! :)
I just found if I rotate the device then the token field's scroll view content size not follows its frame change, which implies the inputTextField's width also not resized.
Do you know a more convenience method to fix this than my layoutSubviews override?
Cheers