Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Swipeview in Listview alters Listview Item Margin functionality on Android #12896

Open
cbradbaer opened this issue Nov 18, 2020 · 1 comment
Assignees
Labels
a/listview Problems with the ListView/TableView a/swipeview e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Milestone

Comments

@cbradbaer
Copy link

Description - With the use of the Swipeview in a Listview, there is no spacing between listivew items. Even if a Margin is specified in the Viewcell contents.

Steps to Reproduce

  1. Create Listview with viewcell contents of a Grid. Give the grid a Margin of 15 which should create a 15 pixel space on all sides of the grid so that there will be a 30 pixel (15 pixel * 2) space between listview items
  2. Run app to verify and verify correct spacing between listview items.
  3. Now add a Swipeview to the listview and rerun the app.
  4. The spacing will be gone and each listview item will be edge to edge. Instead, the spacing occurs like a Padding inside the Grid, growing the size of the grid to fill the space.

Basic Information

  • Version with issue: Xamarin.Forms 5.0 prerelease 5

Visual Studio:
Microsoft Visual Studio Community 2019
Version 16.8.0
VisualStudio.16.Release/16.8.0+30709.132
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

Xamarin 16.8.000.255 (d16-8@d002176)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.8.0.507 (remotes/origin/d16-8@e87b24884)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.8.112 (86385a3)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 11.1.0.17 (d16-8/c0e2b8e)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: be2226b
Java.Interop: xamarin/java.interop@79d9533
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools@2fb1cbc

Screenshots

Without Swipeview
image

With Swipeview
image

XAML Snippets

Without Swipeview

<ListView  x:Name="listView" HasUnevenRows="True" 
                       AbsoluteLayout.LayoutBounds="0.5,0.1,0.95,0.8" 
                       AbsoluteLayout.LayoutFlags="All"
                       BackgroundColor="Transparent" 
                       ItemSelected="listView_ItemSelected">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <Grid  ColumnDefinitions="*,125" RowSpacing="0" RowDefinitions="30,30,25,30" Padding="5" Margin="25" BackgroundColor="Gray">
           

With Swipeview

<ListView  x:Name="listView" HasUnevenRows="True" 
                       AbsoluteLayout.LayoutBounds="0.5,0.1,0.95,0.8" 
                       AbsoluteLayout.LayoutFlags="All"
                       BackgroundColor="Transparent" 
                       ItemSelected="listView_ItemSelected" >
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>

                            <SwipeView BackgroundColor="Transparent">
                                <SwipeView.RightItems>
                                   
                                        <SwipeItem Text="Add Hours"
                                            IconImageSource="addtime.png"
                                            BackgroundColor="LightGreen"
                                            Invoked="OnAddTimeSwipeItemInvoked" 
                                            CommandParameter="{Binding .}"/>
                                        <SwipeItem Text="Remove"
                                            IconImageSource="trash.png"
                                            BackgroundColor="LightPink"
                                            Invoked="OnRemovePlanSwipeItemInvoked"
                                            CommandParameter="{Binding .}"/>
                                    
                                </SwipeView.RightItems>

                                    <Grid  ColumnDefinitions="*,125" RowSpacing="0" RowDefinitions="30,30,25,30" Padding="5" Margin="25" BackgroundColor="Gray">
@cbradbaer cbradbaer added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 18, 2020
@samhouts samhouts added this to New in Triage Nov 18, 2020
@jsuarezruiz jsuarezruiz added a/listview Problems with the ListView/TableView a/swipeview labels Nov 19, 2020
@jsuarezruiz jsuarezruiz self-assigned this Nov 19, 2020
@jsuarezruiz jsuarezruiz added this to Backlog in SwipeView via automation Nov 19, 2020
@jsuarezruiz jsuarezruiz added e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Nov 19, 2020
@jsuarezruiz jsuarezruiz moved this from New to Ready For Work in Triage Nov 19, 2020
@jsuarezruiz
Copy link
Contributor

This issue is related (or the same) as: #9645

@jsuarezruiz jsuarezruiz added the in-progress This issue has an associated pull request that may resolve it! label Nov 23, 2020
@jsuarezruiz jsuarezruiz moved this from Backlog to In Progress in SwipeView Nov 23, 2020
@rmarinho rmarinho added this to To do in v5.0.1 via automation Nov 24, 2020
@rmarinho rmarinho removed this from Ready For Work in Triage Nov 24, 2020
@rmarinho rmarinho moved this from To do to In progress in v5.0.1 Nov 24, 2020
@rmarinho rmarinho added this to the 5.0.1 milestone Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/listview Problems with the ListView/TableView a/swipeview e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! t/bug 🐛
Projects
SwipeView
  
In Progress
v5.0.1
In progress
Development

Successfully merging a pull request may close this issue.

3 participants