This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] ActivityIndicator starting animation only when attached to superview #11339
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can't start animating the ActivityIndicator if it's not attached to the Superview
adamped
commented
Jul 7, 2020
public override void LayoutSubviews() | ||
{ | ||
base.LayoutSubviews(); | ||
if (_element?.IsRunning == true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This triggers when its added to the view
adamped
commented
Jul 7, 2020
public override void Draw(CGRect rect) | ||
{ | ||
base.Draw(rect); | ||
if (_element?.IsRunning == true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't called if it hasn't been triggered by LayoutSubviews() first. But we also need it here, because if you go away then come back again, it needs to call StartAnimating again to redraw it, because it stopped when you move away.
samhouts
approved these changes
Jul 16, 2020
Build error: Error CS0246: The type or namespace name 'CGRect' could not be found (are you missing a using directive or an assembly reference?) |
Added CoreGraphics namespace
samhouts
added
the
retarget-branch-required
PR or associated issues target a milestone. Please target this PR to the matching branch.
label
Aug 4, 2020
samhouts
removed
the
retarget-branch-required
PR or associated issues target a milestone. Please target this PR to the matching branch.
label
Aug 17, 2020
samhouts
added
a/listview
Problems with the ListView/TableView
a/refreshview 🔄
a/shell 🐚
labels
Aug 17, 2020
myroot
pushed a commit
to myroot/Xamarin.Forms
that referenced
this pull request
Aug 19, 2020
…rview (xamarin#11339) * Update ActivityIndicatorRenderer.cs You can't start animating the ActivityIndicator if it's not attached to the Superview * Update ActivityIndicatorRenderer.cs Added CoreGraphics namespace fixes xamarin#10377 fixes xamarin#1989
sung-su
pushed a commit
to sung-su/Xamarin.Forms
that referenced
this pull request
Aug 20, 2020
…rview (xamarin#11339) * Update ActivityIndicatorRenderer.cs You can't start animating the ActivityIndicator if it's not attached to the Superview * Update ActivityIndicatorRenderer.cs Added CoreGraphics namespace fixes xamarin#10377 fixes xamarin#1989
sung-su
pushed a commit
to sung-su/Xamarin.Forms
that referenced
this pull request
Aug 20, 2020
…rview (xamarin#11339) * Update ActivityIndicatorRenderer.cs You can't start animating the ActivityIndicator if it's not attached to the Superview * Update ActivityIndicatorRenderer.cs Added CoreGraphics namespace fixes xamarin#10377 fixes xamarin#1989
Merged
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
a/activityindicator
a/listview
Problems with the ListView/TableView
a/refreshview 🔄
a/shell 🐚
p/iOS 🍎
t/bug 🐛
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
I'm not even sure this is the best way at the moment, but it's a conversation point to move towards a resolution.
The issue comes from having an ActivityIndicator in a CarouselView or UICollectionViewFlowLayout in this case.
You can't call StartAnimating until it has been added to the top UIView (its Superview), otherwise it doesn't do anything. It seems to affect any cell based view, where the cell might not be visible, when the Activity starts its animation.
Issues Resolved
I found this issue locally, in scanning open issues, these could be related
fixes #10377
fixes #1989
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Issue:
Put an ActivityIndicator in a CarouselView (not the first one), and when you move to it, it won't be visible, even if running.
With Fix:
It now will keep showing, even if you go away and come back again.
PR Checklist