I'm doing a view that is like a card that pops up from the bottom of the screen with transition. However, I have overlayed a couple of custom views inside the pop-up card arranged by LazyVGrid. However, while the pop-up card did have pop-up transition, the views inside don't have any transition when showing up. However, they all have the correct transition when hiding.
When I dig a little deeper, I was surprised to find out that:
- at the page of the view, there is no transition whatsoever (preview)
- at the mother view, the pop-up card popped up with transition, but the views inside just appeared with no transition (preview)
- at simulator, everything works perfectly (simulator)
- when hosting on my iPhone, the pop-up card have transition while the views inside don't (the same as the mother view preview situation) (actual iphone)
It is very confusing because the transition works just fine when disappearing
The code cannot be shown but it is something like this:
struct Select: View {
@State var show: Bool = false
var body: some View {
GeometryReader { geometry in
ZStack {
//something something
VStack {
if self.show {
RoundedRectangle(cornerRadius: 30)
.overlay(VStack {
LazyVStack(columns: [GridItem(), GridItem(), GridItem()], spacing: 10) {
CustomView()
CustomView()
})
}
}
}
}
}
}