-1

Edit: not a code question or help me with an assignment or anything. Just had a thought: if one view being transparent still can hide another behind it but above the background

If I get views T -> I -> B where T is top view visible, I is behind top view and B is background.

Can I make T view transparent so the B background is visible but I is still hidden by T top view?

I played with ZStack and clipped attribute with no luck

Maks Shevchenko
  • 105
  • 1
  • 10
  • Would you show your code? And it would be great if you'd demo somehow which effect you try to achieve. – Asperi Dec 24 '20 at 12:54
  • I don't understand why you would want something like this. You could either not present I VC or just hide it with the `isHidden` property – Luca Sfragara Dec 24 '20 at 13:30

1 Answers1

1

Put T and I in the same ZStack

ZStack{
 BView()
 ZStack{
  IView()
  TView()
 }.isHidden(boolean)

}

While you can create isHidden modifier like this response Or you can just play on the opacity

Ouail Bellal
  • 1,554
  • 13
  • 27