-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fix issue with ListView wrong top padding in iOS 15 #14671
Conversation
@@ -271,6 +271,9 @@ protected override void OnElementChanged(ElementChangedEventArgs<ListView> e) | |||
_tableViewController = new FormsUITableViewController(e.NewElement, _usingLargeTitles); | |||
SetNativeControl(_tableViewController.TableView); | |||
|
|||
if (Forms.IsiOS15OrNewer) | |||
_tableViewController.TableView.SectionHeaderTopPadding = new nfloat(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this fixes it, are we sure this is the actual issue? Is this a bug in iOS? Is our code causing this somehow only for iOS 15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely need to analyze this well, we need more time. The PR is a Draft until we review everything better and we are really sure about everything. Also, need to sync with the iOS team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"error CS1061: 'UITableView' does not contain a definition for 'SectionHeaderTopPadding' and no accessible extension method 'SectionHeaderTopPadding' accepting a first argument of type 'UITableView' could be found (are you missing a using directive or an assembly reference?) [D:\agent\2\s\Xamarin.Forms.Platform.iOS\Xamarin.Forms.Platform.iOS.csproj]"
cc @rmarinho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a good forum topic here on this issue. Looks like a design feature of iOS 15.
We've had to override this with a custom renderer when building with latest Xamarin.OS and Xcode. I wonder if this possibly is a good candidate for a platform-specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz Looks like the hosted build agents on Azure DevOps aren't yet configured with the latest Xamarin.iOS and/or Xcode versions. I can confirm the same result in a hosted pipeline.
/azp run |
Pull request contains merge conflicts. |
Azure Pipelines successfully started running 1 pipeline(s). |
@jfversluis When do we expect the 5.0.0 SR6 official release? We are waiting for this fix for our Xamarin app on iOS |
@amiramin476 Later today! :) Check the project boards for things we are working on and target dates. Few days late because of quality checks, but all looks good now! |
so, due to this SR6 change we have to use the latest xcode/visual studio in order for the ios build to run? We started getting build failures like this: |
For now, yes. We're working on fixing that, see #14752 |
Same problem appeared here recently. VStudio for Mac says I'm up to date as of today. The padding issue is still there with XF 4.8 with the latest VStudio and Xamarin.iOS. Any fixes in Xamarin.iOS rather than XF 5.x? |
As mentioned in the other issue, no. This will only be fixed in Forms 5. |
# Conflicts: # Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
Description of Change
Fix issue with ListView wrong top padding in iOS 15.
Issues Resolved
ListView
has a unexpected top padding on iOS 15 #14664API Changes
None
Platforms Affected
Behavioral/Visual Changes
Before
After
Before/After Screenshots
Not applicable
Testing Procedure
Launch Core Gallery and navigate to the issue 14664. If the ListView does not have a top padding, the test has passed.
PR Checklist