在UIAlertController中的UIAlertAction中将图像居中 [英] Centering an image in UIAlertAction in UIAlertController

查看:336
本文介绍了在UIAlertController中的UIAlertAction中将图像居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用以下代码(Swift)将图像添加到UIAlertAction. purpleAction.setValue(pCircle, forKey: "image")

I am currently adding images to UIAlertAction with the following code (Swift). purpleAction.setValue(pCircle, forKey: "image")

如果可能的话,我想在UIAlertAction中将图像居中.当前,UIAlertAction的标题位于中间,图像显示在左侧.

I want to centre the image in the UIAlertAction if possible. Currently the UIAlertAction has a title that is in the centre, and the image appears on the left hand side.

推荐答案

您无法更改图像的框架,需要为您的问题构建自定义的alertView.

You cannot change the frame of image, you need to build custom alertView for your issue.

这篇关于在UIAlertController中的UIAlertAction中将图像居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆