iOS 11 自定义 UIAlertView 渲染不正常

iOS 11 Custom UIAlertView not rendering fine

所以我有一个具有自定义 UIAlertView 的应用程序(自定义是指以编程方式在底部添加 UILabel)。它在 iOS < 11 上工作得很好,但在 iOS 11 上它失败得很惨。因此,在 iOS 10 上它工作正常(左)但它在 iOS 11(右)中失败,当然使用相同的代码

这是我用来制作自定义 UAlertView 的代码。有什么想法吗?

SessionManager *sessionMgr = [SessionManager sharedManager];
NSString *saludoStr = [NSString stringWithFormat:@"¡Bienvenido %@!",self.datosPersonalesResponse.nombre];
NSString *mailStr = [sessionMgr getUserEmail];
NSString *mensajeStr = [NSString stringWithFormat:@"Te hemos enviado un email de \nactivación de cuenta a: \n\n%@\n\nActivá tu cuenta para recibir alertas,\n avisos recomendados y postularte a \nempleos.\n",mailStr];

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:saludoStr message:@"" delegate:self cancelButtonTitle:@"Cerrar" otherButtonTitles:@"No lo recibí", nil];
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
lbl.numberOfLines= 0;

[lbl setFont:[UIFont fontWithName:@"OpenSans" size:13]];
[lbl setTextColor:[UIColor colorWithRed:146/255.0f green:146/255.0f blue:146/255.0f alpha:1.0]];

NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:mensajeStr];
[attributedStr addAttribute:NSFontAttributeName
                      value:[UIFont fontWithName:@"OpenSans-Semibold" size:16]
                      range:NSMakeRange(56,[mailStr length])];

[attributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(56,[mailStr length])];

lbl.attributedText = attributedStr;
lbl.textAlignment = NSTextAlignmentCenter;
[alert setValue:lbl forKey:@"accessoryView"];
[alert show];

UIAlertView 已弃用。请考虑将 UIAlertControllerfull details here.

一起使用