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
[iOS] Fix issue with SwipeView and grouped ListView with scroll #11055
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gross