What is the best way to stop a control becoming the child of another control?

I have an iOSView with an iOSTable control on it and a custom control with the same auto layout constraints as the iOSTable control because either the iOSTable or the custom control can be visible depending on which “mode” the view is operating in. So I switch the visible property of both controls in response to the user tapping a button.

I’ve got the issue whereby the custom control can become a child of the iOSTable control sometimes. Not every time. Just sometimes. And when it does, it no longer becomes visible because, obviously, when the iOSTable control is hidden, so too is the custom control.

I know the workaround is to have the controls not directly on top of each other - have one offset a bit - and then move them to be directly on top of each other at runtime by changing the constraints. But is there a better way? This seems a little kludgy to me.

In the child’s Open() event:

me.parent = nil

[quote=329470:@Gavin Smith]In the child’s Open() event:

me.parent = nil

Not on iOS

Ah, iOS! That’s what I get for posting when going through McDonalds drive-thru with wife and four noisy kids! :slight_smile:

What a lucky man !