--- /dev/null
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 48158, "Hidden controls become transparent, needs manual verification", PlatformAffected.iOS)]
+ public class Bugzilla48158 : TestContentPage // or TestMasterDetailPage, etc ...
+ {
+ protected override void Init()
+ {
+ var grdInner = new Grid { BackgroundColor = Color.Red, IsVisible = false, Padding = new Thickness(10) };
+ var btn = new Button { Text = "Click and verify background is red" };
+ btn.Clicked += (s, e) =>
+ {
+ grdInner.IsVisible = !grdInner.IsVisible;
+ };
+ var grd = new Grid();
+ grd.Children.Add(grdInner);
+ grd.Children.Add(btn);
+ Content = grd;
+ }
+ }
+}
\ No newline at end of file
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla39489.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla36802.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla35736.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla48158.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla22229.xaml">
return new SizeF(0, 0);
}
- public override void Draw(RectangleF rect)
+ public override void LayoutSubviews()
{
- base.Draw(rect);
- if (_blur != null)
+ base.LayoutSubviews();
+ if (_blur != null && Superview != null)
{
- _blur.Frame = rect;
+ _blur.Frame = Bounds;
if (_blur.Superview == null)
Superview.Add(_blur);
}
}
-
protected override void Dispose(bool disposing)
{
if ((_flags & VisualElementRendererFlags.Disposed) != 0)
}
_blur = new UIVisualEffectView(blurEffect);
- SetNeedsDisplay();
+ LayoutSubviews();
}
protected virtual void UpdateNativeWidget()