This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with SwipeView and grouped ListView with scroll (#11055)
Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com> fixes #10908
- Loading branch information
1 parent
dcc1117
commit c68071a
Showing
4 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10908.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ContentPage | ||
xmlns="http://xamarin.com/schemas/2014/forms" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Xamarin.Forms.Controls.Issues.Issue10908" | ||
Title="Issue 10908"> | ||
<ContentPage.Content> | ||
<ListView | ||
x:Name ="lstView" | ||
IsGroupingEnabled="true" | ||
HasUnevenRows="True" | ||
SeparatorVisibility="None" | ||
GroupDisplayBinding="{Binding LongName}" | ||
GroupShortNameBinding="{Binding ShortName}"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<ViewCell> | ||
<SwipeView> | ||
<SwipeView.LeftItems> | ||
<SwipeItem | ||
BackgroundColor="Red" | ||
IconImageSource="icon.png" | ||
Text="Delete"/> | ||
</SwipeView.LeftItems> | ||
<StackLayout | ||
HeightRequest="60"> | ||
<Label Text="{Binding Name}" /> | ||
<Label Text="{Binding Comment}" /> | ||
</StackLayout> | ||
</SwipeView> | ||
</ViewCell> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</ContentPage.Content> | ||
</ContentPage> |
77 changes: 77 additions & 0 deletions
77
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10908.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System.Collections.ObjectModel; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 10908, "[Bug] [iOS]SwipeView not working on Grouped ListView", PlatformAffected.iOS)] | ||
public partial class Issue10908 : ContentPage | ||
{ | ||
public Issue10908() | ||
{ | ||
#if APP | ||
InitializeComponent (); | ||
|
||
Grouped = new ObservableCollection<GroupedIssue10908Model>(); | ||
|
||
var veggieGroup = new GroupedIssue10908Model() { LongName = "vegetables", ShortName = "v" }; | ||
var fruitGroup = new GroupedIssue10908Model() { LongName = "fruit", ShortName = "f" }; | ||
var veggie1Group = new GroupedIssue10908Model() { LongName = "vegetables1", ShortName = "v1" }; | ||
var fruit1Group = new GroupedIssue10908Model() { LongName = "fruit1", ShortName = "f1" }; | ||
var veggie2Group = new GroupedIssue10908Model() { LongName = "vegetables2", ShortName = "v2" }; | ||
var fruit2Group = new GroupedIssue10908Model() { LongName = "fruit2", ShortName = "f2" }; | ||
veggieGroup.Add(new Issue10908Model() { Name = "celery", IsReallyAVeggie = true, Comment = "try ants on a log" }); | ||
veggieGroup.Add(new Issue10908Model() { Name = "tomato", IsReallyAVeggie = false, Comment = "pairs well with basil" }); | ||
veggieGroup.Add(new Issue10908Model() { Name = "zucchini", IsReallyAVeggie = true, Comment = "zucchini bread > bannana bread" }); | ||
veggieGroup.Add(new Issue10908Model() { Name = "peas", IsReallyAVeggie = true, Comment = "like peas in a pod" }); | ||
fruitGroup.Add(new Issue10908Model() { Name = "banana", IsReallyAVeggie = false, Comment = "available in chip form factor" }); | ||
fruitGroup.Add(new Issue10908Model() { Name = "strawberry", IsReallyAVeggie = false, Comment = "spring plant" }); | ||
fruitGroup.Add(new Issue10908Model() { Name = "cherry", IsReallyAVeggie = false, Comment = "topper for icecream" }); | ||
|
||
veggie1Group.Add(new Issue10908Model() { Name = "celery", IsReallyAVeggie = true, Comment = "try ants on a log" }); | ||
veggie1Group.Add(new Issue10908Model() { Name = "tomato", IsReallyAVeggie = false, Comment = "pairs well with basil" }); | ||
veggie1Group.Add(new Issue10908Model() { Name = "zucchini", IsReallyAVeggie = true, Comment = "zucchini bread > bannana bread" }); | ||
veggie1Group.Add(new Issue10908Model() { Name = "peas", IsReallyAVeggie = true, Comment = "like peas in a pod" }); | ||
fruit1Group.Add(new Issue10908Model() { Name = "banana", IsReallyAVeggie = false, Comment = "available in chip form factor" }); | ||
fruit1Group.Add(new Issue10908Model() { Name = "strawberry", IsReallyAVeggie = false, Comment = "spring plant" }); | ||
fruit1Group.Add(new Issue10908Model() { Name = "cherry", IsReallyAVeggie = false, Comment = "topper for icecream" }); | ||
|
||
veggie2Group.Add(new Issue10908Model() { Name = "celery", IsReallyAVeggie = true, Comment = "try ants on a log" }); | ||
veggie2Group.Add(new Issue10908Model() { Name = "tomato", IsReallyAVeggie = false, Comment = "pairs well with basil" }); | ||
veggie2Group.Add(new Issue10908Model() { Name = "zucchini", IsReallyAVeggie = true, Comment = "zucchini bread > bannana bread" }); | ||
veggie2Group.Add(new Issue10908Model() { Name = "peas", IsReallyAVeggie = true, Comment = "like peas in a pod" }); | ||
fruit2Group.Add(new Issue10908Model() { Name = "banana", IsReallyAVeggie = false, Comment = "available in chip form factor" }); | ||
fruit2Group.Add(new Issue10908Model() { Name = "strawberry", IsReallyAVeggie = false, Comment = "spring plant" }); | ||
fruit2Group.Add(new Issue10908Model() { Name = "cherry", IsReallyAVeggie = false, Comment = "topper for icecream" }); | ||
|
||
Grouped.Add(veggieGroup); | ||
Grouped.Add(fruitGroup); | ||
Grouped.Add(veggie1Group); | ||
Grouped.Add(fruit1Group); | ||
Grouped.Add(veggie2Group); | ||
Grouped.Add(fruit2Group); | ||
|
||
lstView.ItemsSource = Grouped; | ||
#endif | ||
} | ||
|
||
ObservableCollection<GroupedIssue10908Model> Grouped { get; set; } | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class Issue10908Model | ||
{ | ||
public string Name { get; set; } | ||
public string Comment { get; set; } | ||
public bool IsReallyAVeggie { get; set; } | ||
public string Image { get; set; } | ||
} | ||
|
||
[Preserve(AllMembers = true)] | ||
public class GroupedIssue10908Model : ObservableCollection<Issue10908Model> | ||
{ | ||
public string LongName { get; set; } | ||
public string ShortName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters