Skip to content
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

Merged
merged 2 commits into from Nov 10, 2014

Conversation

bithug
Copy link

@bithug bithug commented Nov 4, 2014

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

@ayanonagon
Copy link
Contributor

Hey, thanks for the pull-request! Taking a look at this now. :octocat:

@ayanonagon
Copy link
Contributor

This is great, just tried it out on the Venmo app. Thanks again for the pull-request! 🍏

ayanonagon added a commit that referenced this pull request Nov 10, 2014
Content rescaling on layout (orientation) change
@ayanonagon ayanonagon merged commit e0f406e into venmo:master Nov 10, 2014
@ayanonagon
Copy link
Contributor

Just released a new version on CocoaPods (v2.2.2) with this change. 👍

@bithug
Copy link
Author

bithug commented Nov 11, 2014

Cool, thank you!

{
[super layoutSubviews];
self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.frame) - self.horizontalInset * 2, CGRectGetHeight(self.frame) - self.verticalInset * 2);
[self reloadData];
Copy link

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.

Copy link
Author

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.

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants