Search code examples
xamarintvos

UIActivityIndicatorView is black


In a Xamarin.tvOS project I'm working on, we're using a UIActivityIndicatorView on a splash screen when the application first launches, and I recently noticed the color was black. The style is set to WhiteLarge, and I even assigned the color to white manually and it is still black at runtime.

I then tried manually assigning the color in ViewDidLoad() with UIActivityIndicatorView.Color = UIColor.White but it ignored that as well. What is really weird is that if I assign it to something like UIColor.Red, it will be red like I expect. Unless I'm mistaken, the default color of a UIActivityIndicatorView with the style of WhiteLarge should be white anyway, so this makes no sense to me...

Have I encountered some strange accessibility or theme color issue where the color is being reassigned somehow or what?


Solution

  • In my case, my info.plist file was missing an entry called User Interface Style that is automatically added when creating newer Xamarin.tvOS projects that target tvOS 10 or above. When I added it and set it to Automatic (the other two options being Light or Dark), I began to see the behavior I expected.

    I found this link to the Xamarin guide to User Interface Styles to be helpful: https://learn.microsoft.com/en-us/xamarin/ios/tvos/platform/user-interface-styles