簡體   English   中英

我在電報上共享時如何更改tintColor欄按鈕項目?

[英]How to change tintColor bar button item when I share on Telegram?

共享文本時,我想更改條形按鈕項目。

我的代碼如下:

 let color = UIColor.red
    let newFont = UIFont(name: "Avenir Next", size: 16.0)!
    UIBarButtonItem.appearance(whenContainedInInstancesOf: [UINavigationBar.classForCoder() as! UIAppearanceContainer.Type]).setTitleTextAttributes([NSForegroundColorAttributeName: color, NSFontAttributeName: newFont], for: .normal)

就是這樣: 在此處輸入圖片說明

我剛剛更改了按鈕“取消”。 如何更改“發送”欄按鈕的tintColor?

這應該可以解決問題

self.navigationItem.rightBarButtonItem.tintColor = .red

暫無
暫無

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

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