1.tabBar选中文字颜色
//设置选中文字颜色
nav.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.red], for: .selected)
本文介绍如何在SwiftUI应用中为tabBar的选中文字设置颜色,通过使用setTitleTextAttributes方法,可以轻松地改变选中状态下的文字颜色。
1.tabBar选中文字颜色
//设置选中文字颜色
nav.tabBarItem.setTitleTextAttributes([NSAttributedString.Key.foregroundColor:UIColor.red], for: .selected)

被折叠的 条评论
为什么被折叠?