UIAlertView automatic new line gone in iOS8?

It seems that UIAlertView is not compatible with iOS8. I just discovered that all my multi-line UIAlertViews are getting cropped single-line in iOS8 (for message). In iOS7, they are displayed correctly using multi-line.

iOS7: enter image description here

iOS8: enter image description here

[[[UIAlertView alloc] initWithTitle:@"Namn saknas" message:@"Du måste fylla i ditt namn för att kommentera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; 

I know that UIAlertController should be used in iOS8 and later, and UIAlertView is deprecated with iOS8.

BUT SHOULD NOT work as before (ie iOS7) in iOS8? If not, should it not be deprecated from iOS7?

Or am I missing something? This is not just a pseudo-question about how everything should be - I have more than 40 places in the warning code, and it’s not on the schedule to change it all now ...

+2
ios7 ios8 uialertview uialertcontroller
source share
1 answer

Now this problem has been resolved - a response from Apple Engineering has been received:

"Your sample project declares a category on UILabel that overrides -intrinsicContentSize. Overriding UIKit methods leads to unpredictable behavior.

So, I removed the override and everything worked fine.

The redefinition was:

 -(CGSize)intrinsicContentSize { CGSize s = [super intrinsicContentSize]; s = CGSizeMake(s.width, s.height + 4); return s; } 
+1
source share

All Articles