UI issue with nil title in UIAlertView iOS 8 beta 5

前端 未结 4 1257
栀梦
栀梦 2021-02-13 10:41

I have an issue related to UIAlertView while running our app on iOS 8. I am showing an alert with title as nil. It was working fine in iOS 7 but now UI looks odd.

I ha

4条回答
  •  野性不改
    2021-02-13 11:26

    I managed to get decent message alignment without the bold font by:

    1. Setting the title to @"" instead of nil, and
    2. (If IOS8) prepend a "\n" in front of the message.
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" 
                                        message:@"\nLocation field required." 
                                        delegate:nil 
                                        cancelButtonTitle:@"OK" 
                                        otherButtonTitles:nil];
    

    enter image description here

提交回复
热议问题