Esri / arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
https://esri.github.io/arcgis-maps-sdk-dotnet-toolkit/
Apache License 2.0
216 stars 121 forks source link

Popup Viewer does not scroll when height exceeds parent layout #318

Open keithpower opened 4 years ago

keithpower commented 4 years ago

Xamarin Forms 4.3, Android

This can be reproduced in the sample app if you use a feature layer with a lot of fields. The popup viewer will take up the whole height and any fields that don't fit are cut off and you cannot scroll.

You can also reproduce with the sample app if you put the PopupViewer in a grid that has a smaller height than the number of fields in the Ambulance feature layer.

I tried different settings on the parent layout (VerticalOptions) and tried recreating the PopupViewer each time and from code, adding it as a child to the layout.

What I want is a PopupViewer in a Frame that is about 80% of the height of the Android tablet. But my feature layers have a lot of fields so it is cutting them off since it will not scroll.

dotMorten commented 4 years ago

I believe this is by design, and you should use a scroll viewer around it.

keithpower commented 4 years ago

Thanks Morten. I had tried that originally and had troubles. The problem is the scrollviewer needs to know the size of the PopupViewer. Each time I set the PopupManager field to a new value, the PopupViewer refreshes internally but its Height is still exposed as -1. The result is the scrollviewer does not scroll. My hack right now is to set the PopupViewer HeightRequest explicitly each time based on (numberOfFields * 42). Not ideal, there will be problems with this.

I think the PopupViewer would need to update its height each time the PopupManager is set for this to work.

Also, somewhat unrelated, how do you edit fields in the PopupViewer? AllowEdit on the PopupManager is true but not sure how to set it to edit mode.

dotMorten commented 4 years ago

Thank you for the description. Any chance you have a reproducer demonstrating the problem?

Wrt editing, the PopupViewer is exactly that: A viewer. It does not at this point allow editing.