1

我搜索了这个,唯一的解决方案似乎来自 UIAlertViewDelegate。我不想这样做只是为了消除粗体文字。

我用来弹出警报视图的代码如下:

NSString* errPrompt = @"some text here, anything that will not show bold :)";
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:title
                                                message:errPrompt
                                                delegate:nil
                                       cancelButtonTitle:[self getUiText:"OK"]
                                       otherButtonTitles:nil];
[alert show];

在此处输入图像描述

4

3 回答 3

3

这是 iOS 中的一个错误,会影响所有没有设置标题的警报。

有趣的是,大多数标准 iOS 警报(如 App Store 中的)都不会受到影响。

于 2014-10-07T17:10:25.137 回答
2

这适用于我在 iOS 8 上。只是标题中的空字符串,@"" 内没有空格。

  [[[UIAlertView alloc] initWithTitle:@""
     message:@"My message" 
     delegate:nil
     cancelButtonTitle:@"OK"
     otherButtonTitles:nil] show];
于 2015-08-18T08:15:30.407 回答
0

当您未设置警报标题时会发生这种情况。(奇怪,我知道)

将警报的标题设置为。如果你是空的。不想添加任何标题

UIAlertController(title: "", message: "The alert message", preferredStyle: .alert)
于 2021-03-11T23:40:29.480 回答