gpt4 book ai didi

SwiftUI - TabView 禁用背景透明度

转载 作者:行者123 更新时间:2023-12-04 14:49:27 26 4
gpt4 key购买 nike

有没有办法在 TabView 中禁用透明度为 iOS 15 ?如果我的 List没有填满整个屏幕 TabView背景是透明的,我希望始终显示 TabView背景。
enter image description here

最佳答案

感谢@Asperi 为我指明了正确的方向。我找到了 scrollEdgeAppearanceUITabBarAppearance .

@available(iOS 15.0, *)
@NSCopying open var scrollEdgeAppearance: UITabBarAppearance?

Describes the appearance attributes for the tabBar to use when anobservable scroll view is scrolled to the bottom. If not set,standardAppearance will be used instead.


//@available(iOS 15.0, *)
//@NSCopying open var scrollEdgeAppearance: UITabBarAppearance?

let appearance: UITabBarAppearance = UITabBarAppearance()
init() {
UITabBar.appearance().scrollEdgeAppearance = appearance
}
enter image description here

关于SwiftUI - TabView 禁用背景透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69294720/

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