maui icon indicating copy to clipboard operation
maui copied to clipboard

Allow use of UITableViewStyle.GroupedInset style with TableView/ListView

Open warpedgeoid opened this issue 2 years ago • 1 comments

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.

warpedgeoid avatar Jun 16 '22 19:06 warpedgeoid

+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

rjspencer91 avatar Dec 21 '22 17:12 rjspencer91