如何从 IOS 上的列表视图中删除分隔线?

Mah*_*ain 1 nativescript nativescript-angular

我在删除每个列表项后的分隔线时遇到问题,并且无法更改分隔线颜色。

我在 Listview 标签和 CSS 中尝试了 separatorColor="transparent" 属性,但它们都不起作用。我也尝试过 SeparatorVisibility="None" 属性,但没有运气。

我已经尝试过GitHub 提供的这个解决方案,但它不起作用。

这是代码:

<GridLayout row="1" class="shop-list-container">
    <ListView [items]="rewardsPageData?.shops" class="list-group"  height="{{rewardsPageData?.shops?.length * 75}}" separatorColor="transparent">
        <ng-template let-shop="item">
            <GridLayout class="shop-item list-group-item" columns="2*, 6*, 2*" rows="*, auto" (tap)="goToShopDetails(shop.id)">
                <Image src="{{shop.logoImageUrl}}" class="thumb img-circle" col="0" row="0" rowSpan="2" horizontalAlignment="left"></Image>
                <Label class="shop-name" [text]="shop.title" row="0" col="1"></Label>
                <Label class="shop-type" text="{{shop?.category}}" row="1" col="1"></Label>
                <Label text="See location" class="see-location-text" textWrap="true" col="2" row="0" rowSpan="2" horizontalAlignment="right"></Label>
            </GridLayout>
        </ng-template>
    </ListView>
</GridLayout>
Run Code Online (Sandbox Code Playgroud)

ant*_*res 5

我创建了一个孤立的示例,在 CSS 中将 separator-color 设置为透明,并且在 iOS 中对我来说效果很好。注意 app.css 中的 ListView 规则。

如果您删除 CSS 规则并将其设置separatorColor="transparent"为 home.component.html 中的 ListView 对象,则它同样有效。