【发布时间】:2022-06-10 21:49:16
【问题描述】:
【问题讨论】:
【问题讨论】:
假设您的资产目录中有正确的图像(或提前准备好),您可以在视图的 init 中设置它,例如
struct ContentView: View {
init() {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundImage = UIImage(named: "image")
UITabBar.appearance().scrollEdgeAppearance = appearance
}
// ... other code
}
【讨论】: