xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

Xamarin Forms Page Height value is different on second visit #9161

Open D4rkC1own187 opened 4 years ago

D4rkC1own187 commented 4 years ago

Description

The page height value is different when the page is render a second time.

I have a master detail page with navigation. When the default detail page is render the height of the page is 584. When you go back to the detail page the height is 560. It seems the first height value includes the height of the status bar.

Steps to Reproduce

  1. Create a MasterDetailPage with a default detail page
  2. Make the MasterDetailPage the MainPage
  3. Launch application and get height of default detail page.
  4. Change detail page and go back to the default page or re-open default page and get height. The height will now be different

Expected Behavior

Height of page should be the same.

Actual Behavior

Height of page on second visit is different.

Basic Information

Visual Studio Community 2019 for Mac Version 8.4 (build 2657)

Xamarin.Android Version: 10.1.1.0 (Visual Studio Community)

Xamarin.Forms Version: 4.0.0425677

kingces95 commented 4 years ago

Could you please attach a reproduction solution? Also, could you test on a simulator? With both of those we'll be sure we're both looking at the same reproduction. Thanks!

Codelisk commented 4 years ago

The strange thing with this bug is that even the controls themself seems to get smaller.

For example when you put a Entry with Visual Material in there, the height to put the text in changes into a scrollview because it is to little.

D4rkC1own187 commented 4 years ago

I'm not able to attach a reproduction solution. I tried creating a test project but the test project with Xamarin.Forms 4.4.0.991477 gives a Height value of -1 when trying to get height during OnAppearing. The height of the second visit is 560.

In Xamarin.Forms 4.0.0425677 you would get a height of 584 and 560 on second visit during OnAppearing. Was there a change to show Height of -1 during first visit and the correct Height on the second visit?