You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In XCode 13, the new sectionHeaderTopPadding property was added to UITableView objects for iOS 15+. While this property is now accessible directly in the UITableView class in the most recent update of Xamarin in Visual Studio, it is not possible to set the its default value across all UITableView objects using the UITableView.Appearance property, even though the equivalent is now available in XCode.
The reason I ask for this to be added is that the default value for this new property is non-zero, which means any UITableView objects will by default have ugly extra padding added on iOS 15 devices, and in applications with many UITableView objects it would be far simpler and safer to be able to set a default sectionHeaderTopPadding value for all of them in one place (e.g. in AppDelegate) rather than having to manually add lines of code to change that property for each one separately.
Environment
Xamarin.iOS and Xamarin.Mac SDK (in Visual Studio for Windows), currently v15.0.0.8
Example Code
In XCode 13 I can set the default sectionHeaderTopPadding value across the whole app to zero by putting the following Swift code in e.g. AppDelegate:
if #available(iOS 15.0, *) {
UITableView.appearance().sectionHeaderTopPadding = 0.0
}
I would like to be able to achieve the same in Xamarin (in Visual Studio for Windows) by being able to call e.g. (in C#):
if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0)) {
UITableView.Appearance.SectionHeaderTopPadding = 0.0f;
}
which currently is not supported.
The text was updated successfully, but these errors were encountered:
@chamons Thanks for your response. I ran your void_objc_msgSend_nfloat() call in AppDelegate's FinishedLaunching() method, and it appears to have done the trick. That will make a good workaround for now – much appreciated.
Is there a plan to include this new UITableView.Appearance.SectionHeaderTopPadding = 0.0f property in Xamarin bindings? :)
Mostly likely it is not, sectionHeaderTopPadding is not marked with UI_APPEARANCE_SELECTOR in UITableView.h file, so "officially" it is not part of table appearance protocol.
Suggested Addition
In XCode 13, the new
sectionHeaderTopPadding
property was added to UITableView objects for iOS 15+. While this property is now accessible directly in the UITableView class in the most recent update of Xamarin in Visual Studio, it is not possible to set the its default value across all UITableView objects using theUITableView.Appearance
property, even though the equivalent is now available in XCode.The reason I ask for this to be added is that the default value for this new property is non-zero, which means any UITableView objects will by default have ugly extra padding added on iOS 15 devices, and in applications with many UITableView objects it would be far simpler and safer to be able to set a default
sectionHeaderTopPadding
value for all of them in one place (e.g. in AppDelegate) rather than having to manually add lines of code to change that property for each one separately.Environment
Xamarin.iOS and Xamarin.Mac SDK (in Visual Studio for Windows), currently v15.0.0.8
Example Code
In XCode 13 I can set the default
sectionHeaderTopPadding
value across the whole app to zero by putting the following Swift code in e.g. AppDelegate:I would like to be able to achieve the same in Xamarin (in Visual Studio for Windows) by being able to call e.g. (in C#):
which currently is not supported.
The text was updated successfully, but these errors were encountered: