Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我们可以更改AlertController按钮字体吗?_Ios_Swift_Uibutton_Nsattributedstring_Uialertcontroller - Fatal编程技术网

Ios 我们可以更改AlertController按钮字体吗?

Ios 我们可以更改AlertController按钮字体吗?,ios,swift,uibutton,nsattributedstring,uialertcontroller,Ios,Swift,Uibutton,Nsattributedstring,Uialertcontroller,我在stackoverflow和其他网站上使用过不同的解决方案。但我只知道标题、信息字体和颜色的变化。但是我们也可以改变按钮的字体吗 我知道我们可以更改按钮文本颜色,但我也想更改字体。意味着我想定制整个alertcontroller,包括按钮。来自: UIAlertController类旨在按原样使用,而不是按原样使用 支持子类化。此类的视图层次结构是私有的,并且 不能修改 只有在私有API的帮助下才能进行修改。这不是一个好的做法,应用程序可能会因为使用私有API而被拒绝。您可以创建自己的Ale

我在stackoverflow和其他网站上使用过不同的解决方案。但我只知道标题、信息字体和颜色的变化。但是我们也可以改变按钮的字体吗

我知道我们可以更改按钮文本颜色,但我也想更改字体。意味着我想定制整个alertcontroller,包括按钮。

来自:

UIAlertController类旨在按原样使用,而不是按原样使用 支持子类化。此类的视图层次结构是私有的,并且 不能修改


只有在私有API的帮助下才能进行修改。这不是一个好的做法,应用程序可能会因为使用私有API而被拒绝。

您可以创建自己的AlertController。在故事板中或通过代码创建一个新的ViewController,然后以模块方式显示它。这就是我指定默认Alertcontroller的原因,我不想创建ViewController@SAHILMANCHANDA可能与@Scriptable重复。我指定要更改默认按钮字体样式的问题。我知道我们可以更改标题和消息的字体样式和颜色。仔细阅读我的问题,然后发表评论。评论说“可能”,并不是说它肯定是。