Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] ActivityIndicator rendering broken on iOS 11 #14119

Closed
stephanpalmer opened this issue Apr 7, 2021 · 1 comment · Fixed by #14957
Closed

[Bug] [iOS] ActivityIndicator rendering broken on iOS 11 #14119

stephanpalmer opened this issue Apr 7, 2021 · 1 comment · Fixed by #14957

Comments

@stephanpalmer
Copy link

stephanpalmer commented Apr 7, 2021

Description

  • Activity indicator rendering is broken with Xamarin.Forms 5.0 on iOS 11 devices.
  • iOS 10 or lower may also be affected, which I did not check.
  • Rendering works as expected on iOS 12+.

Steps to Reproduce

Run the following app on iOS 11 device or simulator:

public class App : Application
{
    public App()
    {
        MainPage = new ContentPage
        {
            Content = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Children = {
                    new BoxView {
                        VerticalOptions = LayoutOptions.FillAndExpand,
                    },
                    new ActivityIndicator {
                        HorizontalOptions = LayoutOptions.Center,
                        IsRunning = true,
                    },
                    new BoxView {
                        VerticalOptions = LayoutOptions.FillAndExpand,
                    }
                }
            }
        };
    }
}

Expected Behavior

Activity indicator is rendered as usual (background is visible behind the activity indicator).

Actual Behavior

Area covered by the indicator is black.

Basic Information

  • Version with issue: 5.0.0.2012 (and probably most/all 5.0 versions)
  • Last known good version: 4.8.0.1821

Environment

Show/Hide Visual Studio info
=== Visual Studio Community 2019 for Mac ===

Version 8.8 (build 2913)
Installation UUID: 4a873394-294a-4e0e-928f-e087cba2fb74
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000093

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.93 (2020-02/620cf538206) (64-bit)
	Package version: 612000093

=== Xamarin Designer ===

Version: 16.8.0.495
Hash: 1a7425b8f
Branch: remotes/origin/d16-8
Build date: 2020-10-20 10:51:14 UTC

=== Roslyn (Language Service) ===

3.8.0-5.20515.7+713efb0e68d34ab75faaf709e071e5c2d8d4ed0e

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.100/Sdks
SDK Versions:
	5.0.100
	3.1.102
	3.0.101
	2.1.505
	2.1.504
	2.1.302
	2.1.4
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.0
	3.1.2
	3.0.1
	2.1.23
	2.1.15
	2.1.14
	2.1.9
	2.1.8
	2.1.2
	2.0.5

=== .NET Core 3.1 SDK ===

SDK: 3.1.102

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.3 (17715)
Build 12C33

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.Android ===

Version: 11.1.0.17 (Visual Studio Community)
Commit: xamarin-android/d16-8/c0e2b8e
Android SDK: /Users/work/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		7.1 (API level 25)
		8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.6
SDK Build Tools Version: 29.0.3

Build Information: 
Mono: be2226b
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/work/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:30 UTC

=== Android Device Manager ===

Version: 16.8.0.45
Hash: fc0af5f
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:54 UTC

=== Xamarin.iOS ===

Version: 14.4.1.3 (Visual Studio Community)
Hash: e30c41de3
Branch: d16-8
Build date: 2020-10-20 22:18:50-0400

=== Build Information ===

Release ID: 808002913
Git revision: c6189b3851aed1e1aadbef5807d54bd5bb505e5e
Build date: 2020-11-05 07:07:20-05
Build branch: release-8.8
Xamarin extensions: c6189b3851aed1e1aadbef5807d54bd5bb505e5e

=== Operating System ===

Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Tue Jan 12 22:13:05 PST 2021
    root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64

Screenshots

Xamarin.Forms 5.0.0.2012, iOS 11.4 simulator:

Xamarin.Forms 4.8.0.1821, iOS 11.4 simulator:

Reproduction Link

ActivityIndicatorWorking4.8.zip
ActivityIndicatorBroken5.0.zip

Workaround

public class ActivityIndicatorRenderer : Xamarin.Forms.Platform.iOS.ActivityIndicatorRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<ActivityIndicator> e)
    {
        bool isIos11 = UIDevice.CurrentDevice.CheckSystemVersion(11, 0) && !UIDevice.CurrentDevice.CheckSystemVersion(12, 0);
        if (e.NewElement != null && Control == null && isIos11)
            SetNativeControl(new UIActivityIndicatorView(RectangleF.Empty) { ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray });

        base.OnElementChanged(e);
    }
}
@stephanpalmer stephanpalmer added s/unverified New report that has yet to be verified t/bug 🐛 labels Apr 7, 2021
@rachelkang rachelkang added a/activityindicator p/iOS 🍎 5.0.0 Regression on 5.0.0 e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Apr 29, 2021
@cpraehaus
Copy link
Contributor

I can confirm a similar issue: in my case the ActivityIndicator is visible when active at least when I set a custom color for the indicator itself through ActivityIndicator.Color but by default it seems to use BackgroundColor black. When not setting ActivityIndicator.Color explicitly I see a black rectangle and can't see any sign of the indicator circle itself.

Happens on iOS 11, does NOT happen on iOS 12.4.

For now I am setting ActivityIndicator.BackgroundColor to transparent as workaround which seems to avoid this.

Can be reproduced with XF control gallery:
*Actual:
IMG_0013

Expected:
IMG_0014

cpraehaus added a commit to cpraehaus/Xamarin.Forms that referenced this issue Dec 4, 2021
…rer to fix xamarin#14119

Custom UIActivityIndicatorView sub-classes do not seem to receive styling/theme defaults through UIAppearance theming. This leads to activity indicator showing all-black on iOS 11 as reported in xamarin#14119.
jfversluis pushed a commit that referenced this issue Dec 15, 2021
…rer to fix #14119 (#14957)

Custom UIActivityIndicatorView sub-classes do not seem to receive styling/theme defaults through UIAppearance theming. This leads to activity indicator showing all-black on iOS 11 as reported in #14119.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants