简体   繁体   中英

Change the color of moreNavigationController's icons

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!

我完成了一半的工作

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM