自从iOS 16以来,我们可以轻松地使用以下方式自定义navigationBar的背景:
.toolbarBackground(barBackgroundGradient, for: .navigationBar)
.toolbarBackground(.visible, for: .navigationBar)
它运行得很好。
但是,我无法使其在底部工具栏上运行:
.toolbarBackground(barBackgroundGradient, for: .bottomBar)
.toolbarBackground(.visible, for: .bottomBar)
编译成功,但应用程序没有任何变化。
查看开发人员文档,应该可以正常工作...
我也尝试了这个:
.toolbarBackground(barBackgroundGradient, for: .navigationBar, .bottomBar)
它并没有改变任何事情。
有什么想法吗?