dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

Allow use of UITableViewStyle.GroupedInset style with TableView/ListView #8124

Open warpedgeoid opened 2 years ago

warpedgeoid commented 2 years ago

Description

It would be great if TableView and ListView could take advantage of the UITableViewStyle.InsetGrouped style on iOS and Catalyst. Currently, the style is hardcoded to either UITableViewStyle.Plain or UITableViewStyle.Grouped depending on the intent specified for the TableView or ListView.

Public API Changes

Addition of a new option for creating TableViews/ListViews where the underlying native UITableViews use UITableViewStyle.InsetGrouped.

Something like the following platform-specific configuration:

On<iOS>.SetUseInsetGroups(tableView, true);

Intended Use-Case

The creation of settings UIs that match the style of the system Settings pages on iOS. This is also important for matching the visual styling of native apps being ported to .NET and Maui.

rjspencer91 commented 1 year ago

+1

Really need this functionality. We are able to override the CreateNativeControl in a subclass of TableViewRenderer, provide a UITableView(InsetGrouped), and tell MAUI to use that renderer.

But there doesn't seem to be a way to do it for ListView. CreateNativeControl is never called on ListView, looks like it's creating it's own UITableViewController internally?

CollectionView also can't seem to use it as again, internally it's using an UICollectionViewLayout that doesn't support inset grouped styling

osaleem303 commented 5 days ago

+1 same issue here, CreateNativeControl is never called on ListView or I am missing something here?