最佳答案
弄清楚了...添加到您的 tabBarController 类中:
UINavigationControllerDelegate
然后设置:
moreNavigationController.delegate = self
然后添加以下内容:
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
if (self.moreNavigationController.topViewController?.title == "More"){
let moreTableView = self.moreNavigationController.topViewController!.view as! UITableView
for cell in moreTableView.visibleCells {
for views in cell.subviews {
// print(views.description.contains("_UITableViewCellBadgeNeue"))
for items in views.subviews {
if (items is UILabel) {
let item = items as! UILabel
item.textColor = UIColor.white
item.backgroundColor = UIColor(red: 27, green: 27, blue: 27, transparancy: 100)
}
}
}
}
}
}
关于ios - 更改 MoreNavigationController TableView Row 中的角标(Badge)值文本和背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53049108/