@ksyp007 Were you able to find a solution to this?
I've noticed a similar issue when adding a background to a List or ScrollView.
import SwiftUI
struct SwiftUIView: View {
let items = (1...100).map { "Item \($0)" }
var body: some View {
TabView {
Tab("home", systemImage: "house") {
ScrollView {
LazyVStack {
ForEach(items, id: \.self) { item in
Text(item)
.frame(maxWidth: .infinity, alignment: .center)
}
}
}
// breaks scroll-to-top functionality for tab view button
.background {
Color(.systemGroupedBackground)
}
}
}
}
}
#Preview {
SwiftUIView()
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: