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

Scaling issue, behavior of contentSize changed in iOS7 #5

Open
hubgit84 opened this issue Nov 3, 2013 · 0 comments
Open

Scaling issue, behavior of contentSize changed in iOS7 #5

hubgit84 opened this issue Nov 3, 2013 · 0 comments

Comments

@hubgit84
Copy link

hubgit84 commented Nov 3, 2013

Scaling of MTPopupWindow broken since iOS7.

Got it working by changing the resizing code in -(void)doTransitionWithDictionary:(NSDictionary *)dictionary

to following code:

UITextView* textViewToMeasureWith = [[UITextView alloc] initWithFrame:CGRectZero];
[textViewToMeasureWith setFont:[UIFont systemFontOfSize:16]];
[textViewToMeasureWith setText:[dictionary objectForKey:kMessage]];

CGFloat height = [textViewToMeasureWith sizeThatFits:CGSizeMake(290, CGFLOAT_MAX)].height;
[textViewToMeasureWith release];

CGRect newFrame = messageTextView.frame;
// Set the textView frame to the proper size
if (height > 380)
{
    newFrame.size.height = 380;
    [messageTextView setScrollEnabled:YES];
}
else
{
    newFrame.size.height = height;
    [messageTextView setScrollEnabled:NO];
}
messageTextView.frame = newFrame;
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

No branches or pull requests

1 participant