Bug 36662 - MasterDetail.Detail not rendering controls properly when using Maps inside TabbedPage
Summary: MasterDetail.Detail not rendering controls properly when using Maps inside Ta...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Samantha Houts [MSFT]
URL:
: 40421 ()
Depends on:
Blocks:
 
Reported: 2015-12-07 03:32 UTC by Fulvio
Modified: 2016-06-29 16:17 UTC (History)
6 users (show)

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


Attachments
Rendering on Nexus 10 (373.17 KB, image/png)
2015-12-07 23:00 UTC, Fulvio
Details
Rendering on Nexus 10 (without MapPage passed to NavigationPage) (58.02 KB, image/png)
2015-12-07 23:03 UTC, Fulvio
Details
Exceptions thrown when clicking icons when rendering issue is evident (128.70 KB, image/png)
2015-12-07 23:35 UTC, Fulvio
Details


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:
Status:
RESOLVED FIXED

Description Fulvio 2015-12-07 03:32:10 UTC
When rendering Google Maps inside a NavigationPage that's part of a TabbedPage the controls do not work and do not render properly.

This is the *primary issue* that was mentioned in the following thread:

https://forums.xamarin.com/discussion/56663/adding-google-map-to-masterdetailpage-causes-rendering-issues

Further information can be found in that thread along with a sample project.

I've uploaded a sample project (password; support@xamarin.com) demonstrating the rendering issue:

https://www.dropbox.com/s/ccnwg8uo7w0a2vz/TabbedPageRenderingIssueDemo.zip?dl=0

To test the scenario, comment or uncomment the following lines in MapManagerPage.xaml.cs

this.Detail = new NavigationPage (new MapPage { Title = "Map" }) { Title = "Map" }; 
//this.Detail = new NavigationPage (new ContentPage { Title = "Map" }) { Title = "Map" };
When you pass MapPage() to the NavigationPage it renders abnormally as opposed to just rendering an empty ContentPage(). This is the primary issue.
Comment 1 Fulvio 2015-12-07 23:00:36 UTC
Created attachment 14169 [details]
Rendering on Nexus 10

I've attached an image of how it's rendering on Nexus 10 (it renders like this regardless of what version of the simulator you use).
Comment 2 Fulvio 2015-12-07 23:03:05 UTC
Created attachment 14170 [details]
Rendering on Nexus 10 (without MapPage passed to NavigationPage)

This is an attachment of the controls rendering properly by not passing MapPage() to the NavigationPage() (within TabbedPageRenderingIssueDemo/Views/MapManagerPage.xaml.cs), but passing an empty ContentPage() instead.

NOTE: This occurs on every simulator version not just Nexus 10.
Comment 3 Fulvio 2015-12-07 23:05:32 UTC
These are video demonstrations of the issues occurring:

https://www.youtube.com/watch?v=aP6gmS2flGg

https://www.youtube.com/watch?v=hldlGRp1zSg
Comment 4 John Miller [MSFT] 2015-12-07 23:15:47 UTC
Tested on a Nexus 9 tablet with API 23 and I see the layout issues in landscape use the test project from #36597
Comment 5 Fulvio 2015-12-07 23:30:45 UTC
Glad you can confirm. The issue still occurs whether you're in Landscape or Portrait.

Also note the area below the search bar (while you have the MapPage) does not response almost as if there's a transparent area blocking any clicks if that makes sense.

This is all demoed in the YouTube links above.
Comment 6 Fulvio 2015-12-07 23:35:56 UTC
Created attachment 14171 [details]
Exceptions thrown when clicking icons when rendering issue is evident

Also note that when you actually click the icons while the rendering issue is occurring it throws all sorts of exceptions:

Unable to activate instance of type Xamarin.Forms.Platform.Android.ListViewRenderer from native handle 0x47b00025 (key_handle 0x529db610).

These work just fine when the MapPage() is not passed to the NavigationPage().
Comment 7 Fulvio 2015-12-08 00:29:33 UTC
If you comment out setting the Content to the _mapView you get the same issue as passing MapPage() to the NavigationPage():

public async Task MakeMap()
{
	_mapView = new CustomMapView (new NetTopologySuite.Geometries.Point (-37.814107, 144.814107).EnvelopeAroundRadiusMeters (500)) {
		Layers = ((IMapApplication)Application.Current).Layers,
		HeightRequest = 100,
		WidthRequest = 960,
		VerticalOptions = LayoutOptions.FillAndExpand,
		HorizontalOptions = LayoutOptions.FillAndExpand
	};

	_mapView.Tapped += OnTapped;
	_mapView.PropertyChanged += OnPropertyChanged;

	//Content = _mapView;
}
Comment 8 Fulvio 2015-12-08 00:30:15 UTC
Sorry, I meant passing ContentPage() to the NavigationPage().
Comment 9 Fulvio 2015-12-14 01:08:02 UTC
Just wondering whether there's an update on this bug?
Comment 12 Fulvio 2016-04-20 03:29:39 UTC
Below is a screencast demo of the TabbedDemoApplication, which demonstrates the rendering issues within Android when setting a Content property to a Map.

The beginning of the screencast demonstrates that the iOS application with its MasterDetailPage and TabbedPage is working fine.

When opening the application in Android the rendering issue occurs when loading a Map.

When commenting out the "Content = _mapView;" from the MapPage.xaml.cs and replacing it with "Content = new ContentView();" everything then renders and behaves the way its intended.

http://www.screencast.com/users/FulvioCusumano/folders/Default/media/36aeffba-4419-4535-ba56-29954dcef7b0
Comment 13 Glenn Wester 2016-04-20 03:37:07 UTC
Thanks Fulvio, changing status to REOPEN for our team to look into.
Comment 14 Fulvio 2016-06-02 02:04:02 UTC
Hi Glenn,

We have upgraded to Xamarin.Forms/Maps version 2.2.0.45 and now the controls do not appear over the map view, which is great!

However we have run into more issues where the rendering of controls do not appear at all on the Detail.

I have uploaded a screen cast to demonstrate the problem we're getting now.

http://www.screencast.com/users/FulvioCusumano/folders/Default/media/6d1dd567-0dc5-4ea9-8f88-35d56f335408
Comment 16 Samantha Houts [MSFT] 2016-06-09 23:43:17 UTC
*** Bug 40421 has been marked as a duplicate of this bug. ***
Comment 17 Samantha Houts [MSFT] 2016-06-16 16:41:54 UTC
Should be fixed in 2.3.1-pre1
Comment 18 Fulvio 2016-06-17 01:54:26 UTC
Without modifying anything apart from simply switching to the Alpha Channel and then upgrading our Packages to Xamarin.Forms 2.3.0.49 we receive the following exception when we hit `LoadingApplication();` in MainActivity:

Specific cast is not valid: Xamarin.Forms.Platform.Android

  at Xamarin.Forms.Platform.Android.NavigationRenderer.SwitchContentAsync (Xamarin.Forms.Page view, Boolean animated, Boolean removed) [0x000b3] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:196 
  at Xamarin.Forms.Platform.Android.NavigationRenderer.OnPushAsync (Xamarin.Forms.Page view, Boolean animated) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:124 
  at Xamarin.Forms.Platform.Android.NavigationRenderer.PushViewAsync (Xamarin.Forms.Page page, Boolean animated) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:34 
  at Xamarin.Forms.Platform.Android.NavigationRenderer.<OnElementChanged>b__9_0 (Xamarin.Forms.Page p) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:97 
  at Xamarin.Forms.EnumerableExtensions.ForEach[T] (IEnumerable`1 enumeration, System.Action`1 action) [0x00010] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\EnumerableExtensions.cs:38 
  at Xamarin.Forms.Platform.Android.NavigationRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1 e) [0x000d4] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:97 
  at Synchronoss.Platform.Gui.Android.CustomNavigationRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1 e) [0x00003] in /Users/fulvio/Documents/TFS/Product.Mobile/ROAM/main.dev/ROAMplatform/Synchronoss/Platform/Gui/Android/CustomNavigationRenderer.cs:14 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (Xamarin.Forms.Platform.Android.TElement element) [0x000f4] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:190 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:126 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:284 
  at Xamarin.Forms.Platform.Android.MasterDetailContainer.set_ChildView (Xamarin.Forms.VisualElement value) [0x0003d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:44 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.UpdateDetail () [0x0000c] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:317 
  at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0012c] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\MasterDetailPageRenderer.cs:127 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\Platform.cs:284 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.AddChild (Xamarin.Forms.Page page, Boolean layout) [0x00015] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:248 
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x00089] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:237 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x0009b] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:355 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.SetMainPage () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:429 
  at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.LoadApplication (Xamarin.Forms.Application application) [0x0017d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:129 
  at ROAMviewer.Android.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x000a0] in /Users/fulvio/Documents/TFS/Product.Mobile/ROAM/main.dev/ROAMviewer/Android/MainActivity.cs:84
Comment 19 Fulvio 2016-06-19 23:58:46 UTC
Trying to install Xamarin.Forms 2.0.3.49 in a clean solution and keep receiving this when trying to install Xamarin.Forms:

Error downloading 'Xamarin.Android.Support.v7.CardView.23.3.0' from 'https://www.nuget.org/api/v2/package/Xamarin.Android.Support.v7.CardView/23.3.0'.
Comment 20 Fulvio 2016-06-20 03:32:13 UTC
There is no 2.3.1-pre1. Can you provide a source?
Comment 21 Samantha Houts [MSFT] 2016-06-20 17:58:24 UTC
It has not yet been released. We will post an announcement on the Xamarin.Forms forums when it is available. Thank you for you patience! :)
Comment 22 Fulvio 2016-06-21 05:25:54 UTC
Thanks for the update. Can you please provide a rough timeline as to when it will be publicly available? (Less than two weeks, in a month's time, etc).
Comment 23 Bryan Hunter 2016-06-29 16:17:21 UTC
Shipped today in 2.3.1-pre1