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

标签 c# xamarin.ios xamarin.forms

我正在使用 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/

相关文章:

xamarin.ios - 这是 Xamarin Forms 中的内存泄漏吗?

c# - 验证 Internet 连接或 Azure 服务 - Xamarin

c# - EF 6 数据库首先在生成的实体类中使所有属性虚拟化

c# - 在 NAudio 中录制时减少 channel 数

c# - 以表格形式显示数据 C#

c# - UISearchController 和 MvvmCross

c# - 是否可以在 Monotouch 中使用 NSZombieEnabled?

c# - 如何对读取 Excel 阅读器进行单元测试?

iphone - 从 iPad 应用程序打开 iTunes 到特定应用程序(在我自己的应用程序中宣传我自己的应用程序)

c# - PCL 存储包不创建文件夹