繁体   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