Reputation: 1196
I created a view that animate and put it on the index 0
of List with zindex(1)
so its keep it self on front all the time and another view for all other index's with zindex(-1)
...
its work fine for first time but when scroll the list or navigate to detail of list item the second view with zindex(-1) overlap the first view ...
above image show how it suppose to work all the time ...
but this is what happen when after came back from detail of some specific index item ... its cover the first View which have zindex(1)
...
And this is what happened when scroll the list ... all the other views overlap the first view ...
Here is the code
NavigationView{
List(0 ..< 10) { item in
if (item == 0) {
Spacer()
TasiMarketCard()
.padding(.top)
.zIndex(1)
.onTapGesture {
self.isBlur.toggle()
}
}else {
NavigationLink(destination: Text("1")){
HomeItem()
.zIndex(-1)
}
}
}
.navigationBarTitle("Home")
.blur(radius: self.isBlur ? 10 : 0)
}
Upvotes: 1
Views: 832
Reputation: 258247
Just by code reading... try zIndex in different place
NavigationLink(destination: Text("1")){
HomeItem()
}.zIndex(-1) // << here !!
Upvotes: 0