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][iOS] Setting NavigationPage.IsNavigationBarTranslucent = true does not have any effect with Xamarin.Forms 5 #15084

Open gaste opened 2 years ago

gaste commented 2 years ago

Description

As described in the Xamarin.Forms documentation, it should be possible to create a translucent navigation bar on iOS by setting the iOS platform-specific NavigationPage.IsNavigationBarTranslucent attached property to True (either in XAML or using the fluent API). The setting works fine with Xamarin.Forms 4.8 and produces a translucent navigation bar. It does no longer work with Xamarin.Forms 5 and the navigation bar is always opaque.

Steps to Reproduce

  1. Download the sample provided at the reproduction link below.
  2. Open the solution, restore the NuGet packages, compile and run the sample in the iOS simulator.
  3. In the iOS simulator, scroll down in the list view to have the colored items hidden beneath the navigation bar.

Expected Behavior

The navigation bar is translucent and the colored list view items will shine through the navigation bar (see gif in the screenshots section below).

Actual Behavior

The navigation bar is fully opaque (see gif in the screenshots section below).

Basic Information

Environment

Show/Hide Visual Studio info ``` Visual Studio Enterprise 2022 for Mac Preview Version 17.0 Preview (17.0 build 5186) Installation UUID: 9e28c9a1-8d24-4f62-bb34-3cdaeefae468 GTK+ 2.24.23 Mono Framework MDK Runtime: Mono 6.12.0 (2020-02/5ce143a1a88) (64-bit) Package version: 612000158 Roslyn (Language Service) 4.1.0-1.21511.14+c09d760509f00afadf0fa9b6ee7d0c53b70943ca NuGet Version: 6.0.0.262 .NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/6.0.101/Sdks SDK Versions: 6.0.101 6.0.100 MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET Core Runtime Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 6.0.1 6.0.0 Xamarin.Profiler Version: 1.7.0.0 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater Version: 11 Apple Developer Tools Xcode 13.2.1 (19586) Build 13C100 Xamarin.Mac Version: 8.2.0.17 (Visual Studio Enterprise) Hash: 738fde344 Branch: xcode13.1 Build date: 2021-11-09 02:45:15-0500 Xamarin.iOS Version: 15.2.0.17 (Visual Studio Enterprise) Hash: 738fde344 Branch: xcode13.1 Build date: 2021-11-09 02:45:16-0500 Xamarin Designer Version: 17.1.0.87 Hash: d50fb5635 Branch: remotes/origin/main Build date: 2021-12-14 12:53:13 UTC Xamarin.Android Not Installed Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.12 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Android SDK Manager Version: 17.1.0.14 Hash: 9c65d8a Branch: remotes/origin/backport-pr-548-to-main~1 Build date: 2021-12-14 12:53:20 UTC Android Device Manager Version: 17.1.0.13 Hash: 1de1208 Branch: remotes/origin/anchimna/missingLibCmdtoolsFix~1 Build date: 2021-12-14 12:53:20 UTC Build Information Release ID: 1700005186 Git revision: af62eedc3c792b28d8a6764132fe9b25922712af Build date: 2021-12-14 07:51:33-05 Build branch: release-17.0 Operating System Mac OS X 12.1.0 Darwin 21.2.0 Darwin Kernel Version 21.2.0 Sun Nov 28 20:29:10 PST 2021 root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 x86_64 ```

Screenshots

Actual Behavior with Xamarin.Forms 5.0.0.2291

Xamarin Forms 5 0 0 2291-TranslucentNavigationBar-Actual

Expected Behavior with Xamarin.Forms 4.8.0.1821

Xamarin Forms 4 8 0 1821-TranslucentNavigationBar-Expected

Reproduction Link

Xamarin.Froms.TranslucentNavigationBarIssue.zip

Workaround

None known.

jfversluis commented 2 years ago

Hey @gaste thanks for the report! I think this has to do with the fixes we implemented for iOS 15. Apple has introduced a number of changes in this regard and we had to adjust our codebase for that. I think we might have broken this property while doing that. We'll see if we can fix it :)