xamarin / Xamarin.Forms

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

[Bug] iOS gap on top of ListView when inside a shell tab #15679

Open dan3988 opened 1 year ago

dan3988 commented 1 year ago

Description

If you have a data template with a list view inside a StackLayout or Grid, when that data template is used on a shell content in a tab, padding will be added on top of the list view which is not present when there are no tabs.

Steps to Reproduce

  1. Create a xamarin app with a Shell as the main page
  2. Create a data template with a StackLayout containing a ListView
  3. Add a FlyoutItems element
  4. Add a ShellContent element with the ContentTemplate set to the created template
  5. Add a Tab with multiple ShellContent elements inside, using the same data template

Expected Behavior

The contents of all the pages should look the same

Actual Behavior

There is padding added on top of the list views that are inside the Tab element.

Basic Information

Environment

Show/Hide Visual Studio info ``` Microsoft Visual Studio Professional 2022 Version 17.4.4 VisualStudio.17.Release/17.4.4+33213.308 Microsoft .NET Framework Version 4.8.04161 Installed Version: Professional ASP.NET and Web Tools 17.4.326.54890 ASP.NET and Web Tools Azure App Service Tools v3.0.0 17.4.326.54890 Azure App Service Tools v3.0.0 Azure Functions and Web Jobs Tools 17.4.326.54890 Azure Functions and Web Jobs Tools C# Tools 4.4.0-6.22608.27+af1e46ad38d900023f8b1a2839484e471ece1502 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.4.1 (main@2ee106a) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Mono Debugging for Visual Studio 17.4.19 (8c0a575) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 6.4.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Razor (ASP.NET Core) 17.0.0.2246202+61cc048d36a3fc9246d2f04625988b19a18ab8f0 Provides languages services for ASP.NET Core Razor. SQL Server Data Tools 17.0.62207.28050 Microsoft SQL Server Data Tools TypeScript Tools 17.0.10921.2001 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 4.4.0-6.22608.27+af1e46ad38d900023f8b1a2839484e471ece1502 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 17.4.0-beta.22512.4+525d5109e389341bb90b144c24e2ad1ceec91e7b Microsoft Visual F# Tools Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio. VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio VSPackage Extension 1.0 VSPackage Visual Studio Extension Detailed Info Xamarin 17.4.0.312 (d17-4@be7e8d1) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 17.4.0.138 (remotes/origin/d17-4@d36bba3cc9) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 17.4.2 (c457c97) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 13.1.0.1 (d17-4/13ba222) Xamarin.Android Reference Assemblies and MSBuild support. Mono: a96bde9 Java.Interop: xamarin/java.interop/d17-4@fcc33ce2 SQLite: xamarin/sqlite/3.39.3@23e1ae7 Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a Xamarin.iOS and Xamarin.Mac SDK 16.1.1.27 (933c6c2c9) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

``` Build started... 1>------ Build started: Project: XamarinShellBug, Configuration: Debug Any CPU ------ 1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers. 1>XamarinShellBug -> C:\Users\dp\Source\repos\XamarinShellBug\XamarinShellBug\XamarinShellBug\bin\Debug\netstandard2.0\XamarinShellBug.dll 2>------ Build started: Project: XamarinShellBug.iOS, Configuration: Debug iPhoneSimulator ------ 2> Executing SayHello Task to establish a connection to a Remote Server. 2> Properties: 2> SessionId=361519bc944d08c9afe2e5f2b683f5265e49d9ce603a1e83adeedcabc762e55d, 2> Addresss=10.99.14.34, 2> SshPort=22, 2> TcpPort=51146, 2> User=xamarin, 2> AppName=XamarinShellBug.iOS, 2> VisualStudioProcessId=29120, 2> ContinueOnDisconnected=False 2> Detected signing identity: 2> 2> Bundle Id: com.companyname.XamarinShellBug 2> App Id: com.companyname.XamarinShellBug 2>C:\Users\dp\Source\repos\XamarinShellBug\XamarinShellBug\XamarinShellBug.iOS\UIExtensions.cs(62,13,62,17): warning CS8603: Possible null reference return. 2> XamarinShellBug.iOS -> C:\Users\dp\Source\repos\XamarinShellBug\XamarinShellBug\XamarinShellBug.iOS\bin\iPhoneSimulator\Debug\XamarinShellBug.iOS.exe 2> /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/xamarin/Library/Caches/Xamarin/mtbs/builds/XamarinShellBug.iOS/361519bc944d08c9afe2e5f2b683f5265e49d9ce603a1e83adeedcabc762e55d/obj/iPhoneSimulator/Debug/response-file.rsp 2> /usr/bin/mdimport bin/iPhoneSimulator/Debug/ ========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Elapsed 00:08.809 ========== ========== Deploy: 0 succeeded, 0 failed, 0 skipped ========== ========== Elapsed 00:08.809 ========== Launching 'XamarinShellBug.iOS' on 'iPhone 14 iOS 16.2'... Launching... Using Xcode 14.2 found in /Applications/Xcode.app/Contents/Developer Xamarin.Hosting: Xamarin.Hosting Xamarin.Hosting: Version: 75a03ccbfc (refs/heads/xcode14) Xamarin.Hosting: Xcode: /Applications/Xcode.app Xamarin.Hosting: Xcode Version: 14.2 Xamarin.Hosting: Verbosity: 1 Xamarin.Hosting: Simulator watchdogs are already disabled for 'iOS 16.2 (20C52) - iPhone 14'. Xamarin.Hosting: No need to boot (already booted): iPhone 14 Xamarin.Hosting: Installing on iOS 16.2 (20C52) - iPhone 14 by executing 'xcrun simctl install D134CF03-1150-448B-A020-4FF805E68DC6 /Users/xamarin/Library/Caches/Xamarin/mtbs/builds/XamarinShellBug.iOS/361519bc944d08c9afe2e5f2b683f5265e49d9ce603a1e83adeedcabc762e55d/bin/iPhoneSimulator/Debug/XamarinShellBug.iOS.app' Xamarin.Hosting: Could not find any potentially troublesome weak load commands. Xamarin.Hosting: The bundle id com.companyname.XamarinShellBug was successfully installed. Xamarin.Hosting: Creating shared memory for: __XAMARIN_DEBUG_PORT__=56474 Xamarin.Hosting: Created shared memory token: 299829 Xamarin.Hosting: Mapped shared memory: 0x10adbe000 for key 299829 and id 65536 Xamarin.Hosting: Created shared memory id: 65536 Xamarin.Hosting: Launching on iOS 16.2 (20C52) - iPhone 14 by executing 'xcrun simctl launch --console --terminate-running-process D134CF03-1150-448B-A020-4FF805E68DC6 com.companyname.XamarinShellBug -monodevelop-port 56474' with environment: DEVELOPER_DIR=/Applications/Xcode.app NSUnbufferedIO=YES SIMCTL_CHILD___XAMARIN_DEBUG_PORT__=56474 SIMCTL_CHILD_OS_ACTIVITY_DT_MODE=YES SIMCTL_CHILD_NSUnbufferedIO=YES xcrun simctl launch --console --terminate-running-process D134CF03-1150-448B-A020-4FF805E68DC6 com.companyname.XamarinShellBug -monodevelop-port 56474 com.companyname.XamarinShellBug: 33534 objc[33534]: Class NSURLSessionDelegate is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/NetworkServiceProxy.framework/NetworkServiceProxy (0x7ff86437c4f8) and /Users/xamarin/Library/Developer/CoreSimulator/Devices/D134CF03-1150-448B-A020-4FF805E68DC6/data/Containers/Bundle/Application/794F8A09-87E8-48A7-82EC-A73240C92563/XamarinShellBug.iOS.app/XamarinShellBug.iOS (0x10bd610c8). One of the two will be used. Which one is undefined. MonoTouch: Could not install sigaction override, unexpected sigaction implementation. Xamarin.Hosting: Simulated process has exited (could not get process info: Can't find process with ID 33534). Starting Simulator to launch App... The Simulator has been started to launch App... Launch succeeded. The app 'XamarinShellBug.iOS' has been successfully launched on 'iPhone 14 iOS 16.2'. ```

Screenshots

Inside Tab

Outside Tab

Reproduction Link

XamarinShellBug.zip