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

Remove UIActivityIndicatorViewDelegate and instead override ViewRenderer to fix #14119 #14957

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

cpraehaus
Copy link
Contributor

Description of Change

PR #11339 introduced UIActivityIndicatorViewDelegate to cope with changing Superview and start/stop UIActivityIndicatorView accordingly. However this conflicts with UIAppearance/theming of UIActivityIndicatorView. It seems that on iOS 11 (and maybe other versions) sub-classes of UIActivityIndicatorView do not receive correct default theme/appearance leading to activity indicator showing all-black as reported in #14119.

This PR attempts to fix this by removing UIActivityIndicatorViewDelegate and instead handling LayoutSubviews()/Draw()
through overriding ViewRenderer. This way the native UIActivityIndicatorView is managed by ViewRenderer and thus
appearance works on older iOS versions as well.

Issues Resolved

API Changes

None

Platforms Affected

  • iOS

Behavioral/Visual Changes

None

Before/After Screenshots

BEFORE (iOS 11)
IMG_0013

AFTER(iOS 11)
IMG_0015

Testing Procedure

Can be tested with XF control gallery (ActivityIndicator Gallery):

I tested on iOS 11, 12.4, and 15
Tested for regressions using test case B44980 (which should cover #1989).
Could not re-test #11339 since there I found no test case.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

…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
Copy link
Member

Awesome work @cpraehaus thank you so much for this!

@jfversluis
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis jfversluis merged commit b331f96 into xamarin:5.0.0 Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [iOS] ActivityIndicator rendering broken on iOS 11
3 participants