Clicking on Multiple layers that are visible?

NonlinNonlin USMember
edited October 2016 in Xamarin.Forms

I have a GridLayout which is designed in XAML of PageA.

With 4 rows.

Row 0 inlines a control that creates a RelativeLayout with a panel and has the method for animating the panel in and out.
This Row spans the other 3 rows so that and is set to a height of 1 to cover the entire screen. This is so my animation logic in the control works consistently.

In the CodeBehind of PageA I have passed the View into the control and then the control adds the RelativeLayout with the panel into a temp var in the control.

Then in the in the CodeBehind of Page A I set its View to the temp var which now includes the panel that can animate in and out.

Then in PageA I have a button that calls the controls panel animate.

So all that works. PageA has all its contents + the controls contents and the button press animates the panel.

Issue is that the panel is designed to cover half of PageA's original content. The other half being the new panel.
The new panel has a button in it for testing and I can't click it. Focus seems to just be on PageA's XAML and it ignores clicks for any content from the panel that animates in.

What is a solution for this?

Answers

  • JohnHardmanJohnHardman GBUniversity mod
    edited October 2016

    @Nonlin - I might need to read that through again, but if I interpreted it correctly and the button is underneath something else, have you tried using the InputTransparent property?

    For clarity, it might help to post a screenshot.

  • NonlinNonlin USMember

    I have tried InputTransparent property but it disables clicking entirely. I want to click on both.
    I'm trying to do something like a popup but where I can click on the popup and the page behind it.

  • JohnHardmanJohnHardman GBUniversity mod

    @Nonlin - can you show an image of what you are after, even if just drawn by hand and scanned?

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Only InputTransparent on the Element that does not cover the whole screen. Attach your TouchHandler to an element that covers the whole area that you want to react on touch

Sign In or Register to comment.