删除分隔符ListView查看单元格Xamarin.Forms

问题描述 投票:2回答:3

我使用Xamarin.Forms在我的项目中有一个ListView。我使用ViewCellsto显示数据。

现在,两个ViewCell之间有一条分隔线。有一种方法我可以删除它,以便两个ViewCells总是相互接触。

我尝试使用SeperatorVisibility="None",但它没有任何区别。

这是我的代码:

 <ListView x:Name="AList"
                StyleId="AList"
                      Grid.Row="0"
                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width}"
                RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height}"
                      IsVisible="{Binding IsProcessing, Mode=OneWay, Converter={StaticResource booleanNegationConverter}}"
                SeparatorVisibility="None">
        <ListView.BackgroundColor>
          <OnPlatform x:TypeArguments="Color" iOS="Transparent" />
        </ListView.BackgroundColor>

        <ListView.RowHeight>
          <OnPlatform x:TypeArguments="x:Int32" iOS="150" Android="150" WinPhone="170" />
        </ListView.RowHeight>
        <ListView.ItemTemplate>
          <DataTemplate>
            <ViewCell > .......</ViewCell></ListView>
listview xamarin.forms tableviewcell
3个回答
6
投票

SeperatorVisibility =“无”通常会为我做。

你在所有平台上看到这个吗?

您的视图单元格是否包含可能导致它的任何内容?尝试切换到标准TextCell,看看你是否得到了分离器。


1
投票

在ListView中使用SeparatorColor属性

<ListView SeparatorColor="Transparent">
</ListView>

0
投票

Footer=""

到ListView XAML标记

© www.soinside.com 2019 - 2024. All rights reserved.