Change the color of moreNavigationController's icons

房东的猫 提交于 2019-12-07 01:40:58

问题


I've managed to change the navBar tint, the background color and labels' color using this.

But is it possible to change the icons' color?

(those left to tableview's labels)

Thanks!


回答1:


I don't know of a way to change the icon colors, but I don't really think all this hacking is necessary anyway - Apple certainly doesn't recommend it.

As far as I can tell, there is nothing special about the moreViewController, apart from being hard to customize. If it were me, I'd simply create my own custom viewcontroller, say MoreViewController, as a subclass of UITableViewController, add it to a NavigationController and then add that as the fifth and last item in the TabBarController. This table would then have a cell for each additional viewcontroller that I'd like to show. Then I'd be free to customize these cells to my heart's content.




回答2:


This is an old question, nevertheless I'll post a fairly reasonable solution I found.

I first tried setting the global tint color to what I wanted, but that didn't work. Luckily, simply changing the tint color of the table view did work. Adapting code from here:

let color: UIColor
// ...
if let moreTableView = moreNavigationController.topViewController?.view as? UITableView {
    moreTableView.tintColor = color
}

This still doesn't seem to affect the edit view controller, however.

EDIT: There is actually a simpler way to do both, see this answer.



来源:https://stackoverflow.com/questions/5954159/change-the-color-of-morenavigationcontrollers-icons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!