xamarin / Xamarin.Forms

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

TabbedPage backgrouncolor on Ios not set in IoS 15 #14917

Open Swodah opened 2 years ago

Swodah commented 2 years ago

Description

Steps to Reproduce

Expected Behavior

Actual Behavior

Basic Information

Testet on simulator in debug mode and compared to android.

Show/Hide Visual Studio info ``` Microsoft Visual Studio Enterprise 2022 Version 17.0.1 VisualStudio.17.Release/17.0.1+31912.275 Microsoft .NET Framework Version 4.8.04084 Installed Version: Enterprise Visual C++ 2022 00476-80000-00000-AA018 Microsoft Visual C++ 2022 .NET Core Debugging with WSL 1.0 .NET Core Debugging with WSL ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools ASA Service Provider 1.0 ASP.NET and Web Tools 2019 17.0.789.48259 ASP.NET and Web Tools 2019 ASP.NET Web Frameworks and Tools 2019 17.0.789.48259 For additional information, visit https://www.asp.net/ Azure App Service Tools v3.0.0 17.0.789.48259 Azure App Service Tools v3.0.0 Azure Data Lake Tools for Visual Studio 2.6.4000.0 Microsoft Azure Data Lake Tools for Visual Studio Azure Functions and Web Jobs Tools 17.0.789.48259 Azure Functions and Web Jobs Tools Azure Stream Analytics Tools for Visual Studio 2.6.4000.0 Microsoft Azure Stream Analytics Tools for Visual Studio C# Tools 4.0.1-1.21561.4+add472bbed002fcea9232e89793d0762cc71c5cf C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events Microsoft Azure Hive Query Language Service 2.6.4000.0 Language service for Hive query Microsoft Azure Service Fabric Tools for Visual Studio 17.0 Microsoft Azure Service Fabric Tools for Visual Studio Microsoft Azure Stream Analytics Language Service 2.6.4000.0 Language service for Azure Stream Analytics Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft Library Manager 2.1.134+45632ee938.RR Install client-side libraries easily to any web project Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container. Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package Mono Debugging for Visual Studio 17.0.11 (54f19d2) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 6.0.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info Razor (ASP.NET Core) 17.0.0.2152201+3319c75f898522ff4dc9cf0c70035c284264a1de Provides languages services for ASP.NET Core Razor. Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info SQL Server Data Tools 17.0.62110.20190 Microsoft SQL Server Data Tools Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory. Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory. ToolWindowHostedEditor 1.0 Hosting json editor into a tool window TypeScript Tools 17.0.1001.2002 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 4.0.1-1.21561.4+add472bbed002fcea9232e89793d0762cc71c5cf Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual C++ for Cross Platform Mobile Development (Android) 17.0.31822.380 Visual C++ for Cross Platform Mobile Development (Android) Visual F# Tools 17.0.0-beta.21522.2+6d626ff0752a77d339f609b4d361787dc9ca93a5 Microsoft Visual F# Tools Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio. Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio. Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Foo 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 17.0.0.341 (d17-0@ac52790) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 17.0.0.182 (remotes/origin/d17-0@ea204898d) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 17.0.17 (9e779b0) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 12.1.0.5 (d17-0/6b0e6b2) Xamarin.Android Reference Assemblies and MSBuild support. Mono: c633fe9 Java.Interop: xamarin/java.interop/d17-0@febb1367 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.36.0@a575761 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-0@a5194e9 Xamarin.iOS and Xamarin.Mac SDK 15.2.0.17 (738fde344) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Screenshots

image Android and IOS images for comparison image (don't mind the bar colors i reused some settings on them you can set them to whatever you want either in code or outside it.

Reproduction Link

Make a default tabbedPage set colors like so in the Xaml:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="UMS.App.Core.Forms.Pages.Grades.GradesTabbedPageTest" Title="{Binding Path=TitleTextSource}" BackgroundColor="Yellow" Opacity="1">

<ContentPage Title="Tab 1" BackgroundColor="Transparent" Opacity="0.1"/>
<ContentPage Title="Tab 2" BackgroundColor="Red" Opacity="0"/>
<ContentPage Title="Tab 3" />

image

Set color in the code behind for good measure: image

Repository for example project: https://github.com/Swodah/TabbedPageTest

Second issue repository link https://github.com/Swodah/TabbedPageLoadingIssueIOS

Workaround

If you wish you can set the color on the child pages and make sure they aren't transparent, that way the background of the tabbedpage will only be visible until the first page is loaded, though it looks like hell while doing so.

jfversluis commented 2 years ago

Could you please add a reproduction project? Because I'm not sure what you mean by all this, sorry

Swodah commented 2 years ago

@jfversluis I added a link to an example with a new project using a tabbed page. If you launch with android simulator the page should be set to yellow as the first "child page" is transparent. But if you do so with IoS the page is for some reason white.

jfversluis commented 2 years ago

@Swodah, a PR (#14927) for this is open now, would you be able to grab the NuGet as described here and let us know if this fixes this issue? That will greatly speed up the review process.

Besides verifying if this particular issue is fixed also be sure to check other scenarios in the same area to make sure that this fix doesn't accidentally has side-effects 🙂

Thanks!

Swodah commented 2 years ago

I loaded it over to my main project that has multiple different tabbed page implementations, so far i found no issues with this update and it fixes the background color issue.

Swodah commented 2 years ago

@jsuarezruiz I have an issue with a tabbedpage that loads some data on a viewmodel before setting a page and it seems to be IOS only as well, It may be related to this, as it now does update later, it seems like an intermediary view doesn't get set properly or the timing of setting the backgroundcolor is different between the IoS and the Android implementation. I'll try to set up a reproduction example, should I add it here or make a new issue?

jfversluis commented 2 years ago

Please add it here. It's probably related :)

Swodah commented 2 years ago

@jfversluis https://github.com/Swodah/TabbedPageLoadingIssueIOS I'm not 100% sure i reproduced the exact issue i had in my main project, but this does have an issue/difference in how IoS and Android act: Adding child pages programmatically instead of having them preloaded makes it so the tabbedpage on IoS is white instead of the yellow it was supposed to have.

Main project has a bunch more steps with loaders and loading views and stuff in the middle, but this may be the issue that causes it.