diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ViewClipBoundsShouldUpdate.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ViewClipBoundsShouldUpdate.cs new file mode 100644 index 00000000000..ef0c0043a15 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ViewClipBoundsShouldUpdate.cs @@ -0,0 +1,49 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.Forms.Core.UITests; +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.ManualReview)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.None, 888888, "Bounds clipping does not update when View bounds change", PlatformAffected.Android)] + public class ViewClipBoundsShouldUpdate : TestContentPage + { + const string Success = "Success"; + + class TestContentView : ContentView + { + public TestContentView() + { + Content = new Label { Text = Success }; + + IsClippedToBounds = true; + } + } + + protected override void Init() + { + var layout = new StackLayout + { + Children = + { + new Label + { + Text = $"If '{Success}' displays below then this test has passed." + }, + new TestContentView() + } + }; + + Content = layout; + } + + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index e8a376da89d..8c8f375c43f 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -502,6 +502,7 @@ + diff --git a/Xamarin.Forms.Platform.Android/VisualElementTracker.cs b/Xamarin.Forms.Platform.Android/VisualElementTracker.cs index 9ef374e84ef..923b7c5bdab 100644 --- a/Xamarin.Forms.Platform.Android/VisualElementTracker.cs +++ b/Xamarin.Forms.Platform.Android/VisualElementTracker.cs @@ -104,6 +104,13 @@ public void UpdateLayout() Performance.Stop(reference, "MeasureAndLayout"); } + // If we're running sufficiently new Android, we have to make sure to update the ClipBounds to + // match the new size of the ViewGroup + if ((int)Build.VERSION.SdkInt >= 18) + { + UpdateClipToBounds(); + } + Performance.Stop(reference); //On Width or Height changes, the anchors needs to be updated