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