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

[Bug] the screen goes empty on TabbedPage #14911

Open eriiiii opened 2 years ago

eriiiii commented 2 years ago

Description

the screen goes empty and nothing is displayed

Steps to Reproduce

  1. show root page(this page is TabbedPage)
  2. change to next page (this page is ContentPage).
  3. back to root page with method of PopToRootAsync, the root page goes empty.

Expected Behavior

show the root page correctly when back with method of PopToRootAsync.

Actual Behavior

the root page goes empty. (nothing is showed)

Basic Information

Environment

Show/Hide Visual Studio info ``` === Visual Studio Community 2019 for Mac === Version 8.10.12 (build 16) Installation UUID: d7bdbe0e-bcba-4683-b977-196568a57e73 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638) Package version: 612000140 === Mono Framework MDK === Runtime: Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit) Package version: 612000140 === Roslyn (Language Service) === 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb === NuGet === Version: 5.9.0.7134 === .NET Core SDK === SDK: /usr/local/share/dotnet/sdk/5.0.402/Sdks SDK Versions: 5.0.402 3.1.414 MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks === .NET Core Runtime === Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 5.0.11 3.1.20 === .NET Core 3.1 SDK === SDK: 3.1.414 === Xamarin.Profiler === Version: 1.6.15.68 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler === Updater === Version: 11 === Xamarin Designer === Version: 16.11.0.39 Hash: cd672761d Branch: remotes/origin/d16-11 Build date: 2021-10-06 20:09:18 UTC === Apple Developer Tools === Xcode 13.1 (19466) Build 13A1030d === Xamarin.Mac === Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version. === Xamarin.iOS === Version: 15.2.0.1 (Visual Studio Community) Hash: 8fd9e6289 Branch: xcode13.1 Build date: 2021-10-26 10:13:56-0400 === Xamarin.Android === Version: 12.0.0.3 (Visual Studio Community) Commit: xamarin-android/d16-11/f0e3c2d Android SDK: /Users/username/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 7.1 (API level 25) SDK Tools Version: 26.1.1 SDK Platform Tools Version: 30.0.4 SDK Build Tools Version: 30.0.2 Build Information: Mono: c633fe9 Java.Interop: xamarin/java.interop/d16-11@476bb5b ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b === Eclipse Temurin JDK === Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home 2021-07-20 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL === Android SDK Manager === Version: 16.10.0.13 Hash: 1b81df5 Branch: remotes/origin/d16-10 Build date: 2021-09-28 20:47:12 UTC === Android Device Manager === Version: 16.10.0.15 Hash: 89dcc0b Branch: remotes/origin/d16-10 Build date: 2021-09-28 20:47:30 UTC === Build Information === Release ID: 810120016 Git revision: e4f3f43ac50d8e0f83a71dbcb666bb1611a661d7 Build date: 2021-10-28 12:10:44-04 Build branch: release-8.10 === Operating System === Mac OS X 10.16.0 Darwin 20.5.0 Darwin Kernel Version 20.5.0 Sat May 8 05:10:31 PDT 2021 root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 x86_64 ```

Build Logs

Screenshots

Root page

Next page

back to Root page

Reproduction Link

here is our demo project. demo.zip

Workaround

make the animation option from false to true.

(Parent as NavigationPage).Navigation.PopToRootAsync(false);

(Parent as NavigationPage).Navigation.PopToRootAsync(true);
Domik234 commented 2 years ago

Hello,

I have same problem here, but mine works until 5.0.0.2012 (broken only on Android, iOS works).

I am using: MainPage = new NavigationPage(new CustomTabbedPage())

and then calling on CustomTabbedPage: Navigation.PushAsync(new <name>Page())

Here in some cases (meant like different pages) doesn't work Navigation.PopAsync() => Blank Page/Not rendered UI

but using back button works as expected and even when it's not rendered visually, I can tap on a view with TapGestureRecognizer to navigate to the Page again (where everything works as expected) and then after popping back to TabbedPage UI renders and it works too again.

Note: I know that there is a warning not to place TabbedPage into NavigationPage (because of iOS)

EDIT (17.12.2021): I found that this happens when I set the animation of PushAsync to true and PopAsync animation is set to false.

EDIT (22.12.2021): I've tried to use attached "demo" project and works with 5.0.0.2012.

jfversluis commented 2 years ago

See linked issue, seems that this is not specific to TabbedPage