Bug 39448 - Setting Frame Background color disables gestures
Summary: Setting Frame Background color disables gestures
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.1.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
Depends on:
Reported: 2016-03-08 13:55 UTC by Saskia
Modified: 2016-03-15 17:09 UTC (History)
5 users (show)

Tags: Android ac
Is this bug a regression?: ---
Last known good build:

Test page (4.07 KB, text/plain)
2016-03-10 12:41 UTC, Saskia

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Saskia 2016-03-08 13:55:34 UTC
I have a ContentView holding a Frame.
On this ContentView I have set gestures (pan and tap). These gestures work as expected.

If I set the Background color of the frame, the gestures are no longer triggered.
Removing the line makes the gestures work again.

	public class ChartView: Frame
		public ChartView()
			HasShadow = false;
			HorizontalOptions = LayoutOptions.Start;
			VerticalOptions = LayoutOptions.Start;
			BackgroundColor = Color.White; //This line disables the gestures.
			Padding = new Thickness(5);
Comment 1 E.Z. Hart [MSFT] 2016-03-09 19:19:08 UTC
I have not been able to reproduce the behavior where BackgroundColor being set prevents the gestures from working. 

However, I can confirm that the pan gestures do not work at all on a Frame in Android AppCompat. 

Tap gestures are working, but that's only because we recently fixed bug 35477 which was causing them to fail on Frames under AppCompat.
Comment 2 Saskia 2016-03-10 12:41:29 UTC
Created attachment 15344 [details]
Test page

This page shows a similar problem as I have reported in this bug.
Test cases show Frames containing a grid and ContentViews containing a grid.
The grid has backgroundcolor set to transparant (no problem) or set to gray (gestures don't trigger).
Another testcase shows a ContentView containing a Frame. Same result.
As soon as the content of a view has a backgroundcolor, the gestures no longer trigger.

I can 'solve' the problem by setting the gesture on the grid. But since the grid doesn't always cover the entire Frame, I must also set the gesture on the Frame.
Comment 3 E.Z. Hart [MSFT] 2016-03-15 17:09:45 UTC

This behavior is as designed. Views are only input transparent if they are visually transparent. Your solution of setting the gesture on the grid in addition to the frame is the correct one.