gpt4 book ai didi

c# - 如何在 Xamarin Forms 中部分切割 ViewCell 分隔线?

转载 作者:IT王子 更新时间:2023-10-29 04:44:56 28 4
gpt4 key购买 nike

我正在使用 ViewCell 在我的表格设置页面中创建行。我有一个设置可以选择浅色或深色主题。

<ViewCell Height="50">
<StackLayout x:Name="darkTheme" VerticalOptions="FillAndExpand" Padding="20,0,20,0">
<StackLayout Orientation="Horizontal" VerticalOptions="CenterAndExpand">
<Label Text="Dark" XAlign="Center" FontSize="15"/>
<Label x:Name="darkThemeCheckmark" Text="{x:Static local:FontAwesome.FACheck}" FontFamily="FontAwesome" XAlign="Center" IsVisible="false" FontSize="12" HorizontalOptions="EndAndExpand"/
</StackLayout>
</StackLayout>
</ViewCell>
<ViewCell Height="50">
<StackLayout x:Name="lightTheme" VerticalOptions="FillAndExpand" Padding="20,0,20,0">
<StackLayout Orientation="Horizontal" VerticalOptions="CenterAndExpand">
<Label Text="Light" XAlign="Center" FontSize="15"/>
<Label x:Name="lightThemeCheckmark" Text="{x:Static local:FontAwesome.FACheck}" FontFamily="FontAwesome" XAlign="Center" IsVisible="false" FontSize="12"/>
</StackLayout>
</StackLayout>
</ViewCell>

每当我从深色主题切换到浅色主题时,我的行之间的左侧都有微弱的光线,我似乎无法摆脱。请引用下图:

enter image description here

enter image description here

在我的渲染器中,我设置了以下内容:

tableView.LayoutMargins = new UIEdgeInsets() { Left = 20 };
cell.SeparatorInset = new UIEdgeInsets() { Left = 20 };
cell.LayoutMargins = new UIEdgeInsets() { Left = 20 };

谁知道如何摆脱这条线?

编辑:

我希望它看起来像下面这样: enter image description here

最佳答案

我是 xamarin 的新手,但是,根据 this post您需要在 UITableView 和 UITableViewCell 子类上执行此操作。

希望对您有所帮助。 :)

关于c# - 如何在 Xamarin Forms 中部分切割 ViewCell 分隔线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43734249/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com