如何将自定义字体应用于UIAlertController上的消息?

时间:2018-08-31 11:24:27

标签: ios swift uialertcontroller

我已经尝试过了,但是没有用。我也想更改字体系列和字体大小。

let attributedMessage: NSMutableAttributedString = NSMutableAttributedString(string: NSLocalizedString("ConfirmLogout", comment: "Confirm for logout"))
    attributedMessage.setColor(color: UIColor.green1(), forText: "Confirm")
    let alert = UIAlertController(title: NSLocalizedString("ProfileUpdated", comment: "Profile Updated"), message: attributedMessage, preferredStyle: UIAlertControllerStyle.alert)



alert.addAction( UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
alert.addAction(UIAlertAction(title: "Log Out", style: .default, handler: nil))
self.present(alert, animated: true, completion: nil)

0 个答案:

没有答案
相关问题