UIAlertView 是否可以将图像作为标题?

UIAlertView is it possible to put image as Title?

正如我所说的标题,是否可以将图像发送到 UIAlertView 以显示为标题?

我可以这样做的其他方法是不显示标题并将图像作为内容发送,然后在图像之后显示其余文本。

提前致谢。

不是,官方文档中说的UIAlertView does not support images in the title. Also you should not attempt to insert your own UIImageView in UIAlertView

The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

只需创建您自己的显示视图,您现在可以在其中显示它 UIWindow 以滚动您自己的警报视图。