зеркало из https://github.com/DeGsoft/maui-linux.git
[Enhancement] Added GroupHeaderStyle property for iOS specific ListView class (#4616)
* Added group header style property for ios specific list view class * removed redundant test line
This commit is contained in:
Родитель
85c2f8d8b9
Коммит
961052e806
|
@ -0,0 +1,9 @@
|
|||
|
||||
namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
|
||||
{
|
||||
public enum GroupHeaderStyle
|
||||
{
|
||||
Plain,
|
||||
Grouped
|
||||
}
|
||||
}
|
|
@ -26,5 +26,28 @@
|
|||
SetSeparatorStyle(config.Element, value);
|
||||
return config;
|
||||
}
|
||||
|
||||
public static readonly BindableProperty GroupHeaderStyleProperty = BindableProperty.Create(nameof(GroupHeaderStyle), typeof(GroupHeaderStyle), typeof(FormsElement), GroupHeaderStyle.Plain);
|
||||
|
||||
public static GroupHeaderStyle GetGroupHeaderStyle(BindableObject element)
|
||||
{
|
||||
return (GroupHeaderStyle)element.GetValue(GroupHeaderStyleProperty);
|
||||
}
|
||||
|
||||
public static void SetGroupHeaderStyle(BindableObject element, GroupHeaderStyle value)
|
||||
{
|
||||
element.SetValue(GroupHeaderStyleProperty, value);
|
||||
}
|
||||
|
||||
public static GroupHeaderStyle GetGroupHeaderStyle(this IPlatformElementConfiguration<iOS, FormsElement> config)
|
||||
{
|
||||
return GetGroupHeaderStyle(config.Element);
|
||||
}
|
||||
|
||||
public static IPlatformElementConfiguration<iOS, FormsElement> SetGroupHeaderStyle(this IPlatformElementConfiguration<iOS, FormsElement> config, GroupHeaderStyle value)
|
||||
{
|
||||
SetGroupHeaderStyle(config.Element, value);
|
||||
return config;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1368,7 +1368,10 @@ namespace Xamarin.Forms.Platform.iOS
|
|||
internal bool _usingLargeTitles;
|
||||
bool _isRefreshing;
|
||||
|
||||
public FormsUITableViewController(ListView element, bool usingLargeTitles)
|
||||
public FormsUITableViewController(ListView element, bool usingLargeTitles)
|
||||
: base(element.OnThisPlatform().GetGroupHeaderStyle() == GroupHeaderStyle.Plain
|
||||
? UITableViewStyle.Plain
|
||||
: UITableViewStyle.Grouped)
|
||||
{
|
||||
if (Forms.IsiOS9OrNewer)
|
||||
TableView.CellLayoutMarginsFollowReadableWidth = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче