Yogeshwaran
Yogeshwaran

Reputation: 105

Listview items between space in xamarin forms

This is my listview class

public class ListViewClass : ListView
{        
    public ListViewClass ()
    {    
        var cell = new DataTemplate(typeof(ViewCellClass));                
        ItemTemplate = cell;
        SeparatorVisibility = SeparatorVisibility.None;
        this.Style = (Style)Application.Current.Resources["commonBottomMarginThickness"];
        HasUnevenRows = true;                    
    }            
}

I attached the screenshot. how to put space between the listview items above and below.

enter image description here

Upvotes: 1

Views: 948

Answers (1)

Diego Rafael Souza
Diego Rafael Souza

Reputation: 5314

Add the value Transparent to your SeparatorColor property.

Like this:

public ListViewClass ()
{    
    var cell = new DataTemplate(typeof(ViewCellClass));                
    ItemTemplate = cell;
    SeparatorVisibility = SeparatorVisibility.None;
    SeparatorColor = Color.Transparent;
    this.Style = (Style)Application.Current.Resources["commonBottomMarginThickness"];
    HasUnevenRows = true;                    
}    

Upvotes: 1

Related Questions