有没有办法改变UIAlertAction字体,因为我只在UIAlertController的标题和消息中发现了如何改变字体。我也找到了改变颜色的方法,但是我就是找不到改变字体的方法。
发布于 2018-09-19 15:59:53
let titleAttributed = NSMutableAttributedString(
string: Constant.Strings.cancelAbsence,
attributes: [NSAttributedStringKey.font:UIFont(name:"FONT_NAME",size: FONT_SIZE)]
)
let messageAttributed = NSMutableAttributedString(
string: Constant.Strings.cancelAbsence,
attributes: [NSAttributedStringKey.font:UIFont(name:"FONT_NAME",size: FONT_SIZE)]
)
let alertController = UIAlertController(
title: "",
message: "",
preferredStyle: UIAlertControllerStyle.YOUR_STYLE
)
alertController.setValue(titleAttributed, forKey : "attributedTitle")
alertController.setValue(messageAttributed, forKey : "attributedMessage")
present(alertController, animated: true, completion: nil)https://stackoverflow.com/questions/52400886
复制相似问题