gpt4 book ai didi

ios - 更改选项卡栏外观

转载 作者:行者123 更新时间:2023-11-29 05:14:41 24 4
gpt4 key购买 nike

我正在尝试使用新的 swiftui 框架更改 tabView 外观。我试过这个:

appearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.font: UIFont(name: "Lato-Regular", size: 11)!]
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [NSAttributedString.Key.foregroundColor: Color.TabViewItemNormalColor.uiColor()]

appearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.font: UIFont(name: "Lato-Regular", size: 11)!]
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [NSAttributedString.Key.foregroundColor: Color.TabViewItemNormalColor.uiColor()]

但只有文本颜色发生了变化,字体与以前相同

最佳答案

尝试以下操作

appearance.stackedLayoutAppearance.normal.titleTextAttributes = [
NSAttributedString.Key.font: UIFont(name: "Lato-Regular", size: 11)!,
NSAttributedString.Key.foregroundColor: Color.TabViewItemNormalColor.uiColor()
]

appearance.stackedLayoutAppearance.selected.titleTextAttributes = [
NSAttributedString.Key.font: UIFont(name: "Lato-Regular", size: 11)!,
NSAttributedString.Key.foregroundColor: Color.TabViewItemNormalColor.uiColor()
]

关于ios - 更改选项卡栏外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59302679/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com