我有一个UITabBarController。它有两个选项卡。它们被标记为“FirstTitle”和“SecondTitle”。如何找出这些标题的默认字体大小?
在ViewDidLoad中,对于我的第一个View Controller,它对应于我的第一个标签,我尝试过:
print(self.tabBarController?.tabBar.items?[0].titleTextAttributes(for:
.normal))
print(self.tabBarController?.tabBar.items?[0].titleTextAttributes(for:
.selected))
let appearance = UITabBarItem.appearance()
print(appearance.titleTextAttributes(for: .normal))
所有这些都返回“零”。此外,Main.storyboard中任何位置显示的选项卡栏都没有默认字体大小。