IsAttributionTextVisible Bug

1264
4
01-25-2017 10:18 AM
AndyWright
Occasional Contributor

I've found a bug with the IsAttributionTextVisible property on the MapView.  It works fine for Android, but throws an error in iOS at app launch time.  I've tried setting it in XAML, code behind, and using the OnPlatform stuff and it's the same result.  Question to the development team.  Is it sufficient to report this to you here or is there a more official place for me to do that?

0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

Do you have a repro and a stacktrace + error message?

0 Kudos
AndyWright
Occasional Contributor

Hi Morten,

To repro just create a new Xamarin.Forms Shared ArcGIS Runtime app from your template.  Add the IsAttributionTextVisible="false" property to the MapView in the MapPage.xaml and then run that on an iOS device or simulator.  You'll get the error shown below ...

Error Message/StackTrace:

System.NullReferenceException: Object reference not set to an instance of an object
at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at EFCloud.Application.Main (System.String[] args) [0x00008] in /Users/xamarindeveloper/Documents/EpochFieldCloud/EFCloud/EFCloud.iOS/Main.cs:9

0 Kudos
dotMorten_esri
Esri Notable Contributor

Looks like a bug. As a potential workaround, could you try setting the property after the view has loaded?

0 Kudos
AndyWright
Occasional Contributor

Morten,

It didn’t initially work even after the map had loaded and then it hit me that this might work, and it did. I did not have to wait for the map to finish loading to set this property either. So it looks like the bug is in setting it in XAML.

Device.BeginInvokeOnMainThread(() =>

{

MapView.IsAttributionTextVisible = false;

});

0 Kudos