OGeek|极客世界-中国程序员成长平台

标题: ios - 如何减小 UIAlertView 中按钮的字体大小,有什么办法吗? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 14:20
标题: ios - 如何减小 UIAlertView 中按钮的字体大小,有什么办法吗?

我正在使用 UIalertView,

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:appname
                                                message"some blah blah!"
                                               delegate:nil
                                      cancelButtonTitle"Ok"
                                      otherButtonTitles"Free content", nil];
[alert show];

我想在弹出警报 View 时减小“免费内容”的字体大小(类似于 arial-9)字体,有没有办法减小字体或以自定义方式设计?

谢谢,



Best Answer-推荐答案


You cannot customize the appearance of UIAlertView,

因为此类的 View 层次结构是私有(private)的,并且必须不得修改

更多信息请参见 UIAlertView 类引用:UIAlertView Class Reference:

为什么不呢?

you can use Custom AlertView with desire apperance

查看下面的链接如何创建具有所需外观的自定义警报 View CustomAlertView Sample

关于ios - 如何减小 UIAlertView 中按钮的字体大小,有什么办法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28581778/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4