Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Panel Animation Voids Tap Gestures

$
0
0

When using Android, if I start a view outside the boundaries of a page and then slide it in by using TranslateTo all gestures and button clicks of the view stop working. I've noticed that the section outside the boundaries is what stops working, for example: if the view is half outside the page, only the half that was outside does not register input. I've used different methods to try to go around this problem such as making the view invisible and then moving it outside, and it works but the view is visible while going outside the boundaries. I found that using TranslationX allows me to instantly move the view but if I move it outside the boundaries the same behavior happens.

Here is the piece of code that sets a StackLayout so that it can be clicked:


var muro = new StackLayout {

            Padding = 15,
            Orientation = StackOrientation.Horizontal,
            Spacing = 20,
            Children = {
                        new Image {
                            Source = "Muro.png"
                        },
                        new Label {
                            VerticalOptions = LayoutOptions.Center,
                            Text = "Muro",
                            FontAttributes = FontAttributes.Bold,
                            TextColor = Color.Black
                        }
                    }
        };
        muro.GestureRecognizers.Add(new TapGestureRecognizer {
            Command = new Command(async o => await this.GoToPage(MuroPage.GetMuroPageInstance))
        });

And here is how I do the animations:


{
if (visible)
await Content.TranslateTo(-Content.Width, 0);
else
await Content.TranslateTo(0, 0, 250);
}

On Windows Phone the code works perfectly.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>