我使用Xamarin.Forms在我的项目中有一个ListView
。我使用ViewCells
to显示数据。
现在,两个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>
SeperatorVisibility =“无”通常会为我做。
你在所有平台上看到这个吗?
您的视图单元格是否包含可能导致它的任何内容?尝试切换到标准TextCell,看看你是否得到了分离器。
在ListView中使用SeparatorColor属性
<ListView SeparatorColor="Transparent">
</ListView>
加
Footer=""
到ListView XAML标记