1
设置消息左对齐我使用UIAlertView中,如下UIAlertView中 - 在IOS
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Review" message:[dictionary valueForKey:@"Review"] delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
UIAlertView中使用附件查看
NSMutableString *message = [NSMutableString string];
NSString *title = [dictionary valueForKey:@"REVIEW"];
[message appendString:title];
[message appendString:@"\n"];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Review" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert setValue:[self getLabelWithMessage:message withTitle:title] forKey:@"accessoryView"];
[alert show];
第二个解决方案工作正常对我来说,按照以下解决方案
Simple UIAlertView with NSAttributedString(s)
但这种解决方案将其批准的苹果?
[alert setValue:[self getLabelWithMessage:message withTitle:title] forKey:@"accessoryView"];
我需要在UIAlertView中设置左对齐到消息。
任何其他解决方案的建议。
在此先感谢。
使用alertView子视图的解决方案无法正常工作...! – Vidhyanand
虽然这篇文章是关于几年前,但它似乎是相当新的,所以我觉得糟糕,但'UIAlertView'已被弃用,因为iOS9和['UIAlertController'](https://developer.apple。 com/documentation/uikit/uialertcontroller)是该块上的新成员。 – holex