Skip to content

Commit

Permalink
Fix "VirtualView cannot be null here"
Browse files Browse the repository at this point in the history
  • Loading branch information
prok155 committed Dec 19, 2023
1 parent c51d66f commit ea52878
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ protected override void OnLayout(bool changed, int left, int top, int right, int
systemPadding = new Thickness();
}

(PopupHandler.VirtualView as PopupPage).SetValue(PopupPage.SystemPaddingProperty, systemPadding);
(PopupHandler.VirtualView as PopupPage).SetValue(PopupPage.KeyboardOffsetProperty, keyboardOffset);
(PopupHandler.VirtualView as PopupPage)?.SetValue(PopupPage.SystemPaddingProperty, systemPadding);
(PopupHandler.VirtualView as PopupPage)?.SetValue(PopupPage.KeyboardOffsetProperty, keyboardOffset);

if (changed)
(PopupHandler.VirtualView as PopupPage).Layout(new Rect(Context.FromPixels(left), Context.FromPixels(top), Context.FromPixels(right), Context.FromPixels(bottom)));
(PopupHandler.VirtualView as PopupPage)?.Layout(new Rect(Context.FromPixels(left), Context.FromPixels(top), Context.FromPixels(right), Context.FromPixels(bottom)));
else
(PopupHandler.VirtualView as PopupPage).ForceLayout();
(PopupHandler.VirtualView as PopupPage)?.ForceLayout();
base.OnLayout(changed, left, top, right, bottom);
//base.OnLayout(changed, 20, 500, 1080, 2000);
//base.OnLayout(changed, visibleRect.Left, visibleRect.Top, visibleRect.Right, visibleRect.Bottom);
Expand Down

0 comments on commit ea52878

Please sign in to comment.