Is there an equivalent of WPFs Visibility.Hidden

JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

I need to hide a control from view, but keep it in the layout pass - the same as WPF does with Visibility.Hidden.
IsVisible is the equivalent of Visible and Collapsed - shown and in the layout or hidden and not in the layout but I'd like the third option - hidden but in the layout.

Is this possible?

Posts

  • DanVanderboomDanVanderboom USUniversity ✭✭

    Yes, set the element's Opacity to 0.

    This will keep the control part of the layout, so it will consume the same space. If you have it on top of any other controls, it will also prevent you from interacting with whatever is underneath it, so you'll have to manage the z order if that's an issue for you.

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭

    OK - so essentially no. I use hidden to do things like allocate space for 2 controls and only show one based on the current settings so need space for both. I guess I'll have to use opacity and think hard about my z order.

    Thanks Dan.

Sign In or Register to comment.