A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
If you want to get WindowInsets, your frmPossibleBids should be attached in the layout.
So, I add a AddOnAttachStateChangeListener for frmPossibleBids, I can get the top value in the OnViewAttachedToWindow method like following code.
//add AddOnAttachStateChangeListener
frmPossibleBids.AddOnAttachStateChangeListener(new FrmPossibleBidsttachStateChangeListener());
// achieve this AddOnAttachStateChangeListener class.
internal class FrmPossibleBidsttachStateChangeListener : Java.Lang.Object, View.IOnAttachStateChangeListener
{
public void OnViewAttachedToWindow(View attachedView)
{
var topValue= attachedView.RootWindowInsets.GetInsets(WindowInsets.Type.StatusBars()).Top;
}
public void OnViewDetachedFromWindow(View detachedView)
{
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.