簡體   English   中英

如何更改 UIAlertAction 標題的顏色

[英]How to change the color of UIAlertAction Title

我想更改 UIAlertActionSheet 的標題顏色。

“alert.view.tintColor”改變所有動作按鈕的顏色,但不改變標題。

你可以試試這個,它可能對你有用

let myCancelAlert = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler:nil)
            myCancelAlert.setValue(UIColor.black, forKey: "titleTextColor")
            alert.addAction(cancelAlert)

暫無
暫無

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

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