MTPopupWindow
MTPopupWindow copied to clipboard
Scaling issue, behavior of contentSize changed in iOS7
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;