簡體   English   中英

NSMutableAttributedString作為UIAlertAction的標題-Swift

[英]NSMutableAttributedString as UIAlertAction's title - Swift

是否可以將NSMutableAttributedString設置為AlertAction的標題? 我的目標是在UIAlertAction標題中可視化具有良好設計的數學表達式。

let action = UIAlertAction(title: myNSMutableAttributedString, style: UIAlertActionStyle.default) {(result : UIAlertAction) -> Void in

}

先謝謝您的幫助。

在不訪問私有API的情況下, 無法NSAttributedString用作UIAlertAction的標題,因為將attributedTitle設置為屬性字符串的方法在這里不起作用( 有關此問題的詳細信息,請參閱此問題 )。

我將為此創建一個自定義類或使用警報庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM