protected override void Dispose(bool disposing) { if (disposing && _footerViewRenderer != null) { if (_footerViewRenderer.Element != null) { _footerViewRenderer.Element.SizeChanged -= HandleOnFooterViewSizeChanged; } _footerViewRenderer.DisposeRendererAndChildren(); _footerViewRenderer = null; } base.Dispose(disposing); }
void UpdateFooterView() { _footerViewRenderer?.DisposeRendererAndChildren(); VisualElement footerView = FormsElement?.FooterView; if (footerView != null) { _footerViewRenderer = GetOrCreateRenderer(footerView); View.AddSubview(_footerViewRenderer.NativeView); SizeRequest sizeRequest = footerView.Measure(View.Frame.Width, double.PositiveInfinity, MeasureFlags.IncludeMargins); double heightRequest = sizeRequest.Request.Height; SetBottomPadding(heightRequest); footerView.SizeChanged += HandleOnFooterViewSizeChanged; } }