【发布时间】:2020-06-16 00:16:18
【问题描述】:
我在使用 Xamarin.Forms 的项目中有一个 ListView。我使用ViewCells来显示数据。
现在,两个 ViewCell 之间显示了一条分隔线。有一种方法可以删除它,以便两个 ViewCell 始终相互接触。
我尝试使用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编写自己的CustomRenderer,例如SeperatorlessListView。对于 iOS,你可以看看这个:forums.xamarin.com/discussion/comment/74497Good Luck :)
标签: listview xamarin.forms tableviewcell