I am building an iPad app and occurred this weird laggy transition when I use a NavigationBar and a ScrollView. You can see it here (I don't know if there is another way to share videos).
My code looks like this:
NavigationView {
ZStack {
BackgroundView()
GridView()
}
.navigationTitle("HUB")
.toolbar{
...
}
}
.navigationViewStyle(StackNavigationViewStyle())
BackgroundView:
var body: some View {
ZStack {
Image("background_light")
.resizable()
.ignoresSafeArea()
VisualEffectView(effect: UIBlurEffect(style: .light))
.ignoresSafeArea()
}
}
GridView:
ScrollView {
LazyVGrid(columns: homeViewModel.layout, spacing: 20, content: {
ForEach(homeViewModel.itemButtons, id: \.self) { item in
Button()
...
}
}
}
Now I wonder whether it is a SwiftUI bug or I did something wrong and I hope you can help me.
Thank you and greetings from Germany.
EDIT: changed .navigationBarTitle()
to .navigationTitle()