nativescript - 如何从 IOS 的列表视图中删除分隔线?
问题描述
我在删除每个列表项后的分隔线时遇到问题,并且无法更改分隔线颜色。
我在 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>
解决方案
我创建了一个孤立的示例,在 CSS 中将分隔符颜色设置为透明,并且在 iOS 中对我来说效果很好。注意 app.css 中的 ListView 规则。
如果您删除 CSS 规则并将其设置separatorColor="transparent"
为 home.component.html 中的 ListView 对象,它同样有效。
推荐阅读
- r - mlr - 问题调整 classif.ctree
- excel - 如何对每行进行条件格式化?
- sql - 如何将此查询转换为 HiveSQL?
- python - Windows 10/Linux (Manjaro 18.1.5) 上的 Python 3.8:使用 pip 安装的 TestPyPI 包的 ModuleNotFoundError
- asp.net-core-signalr - .Net Core 3.1 SignalR 客户端 - 如何将 JWT 令牌字符串添加到 SignalR 连接配置?
- python - 将列表的每个元素增加一定数量
- angular - Service Worker 注册失败:TypeError:无法为范围注册 ServiceWorker
- python - 脸书刮刀
- python - 是否有类似于 TensorFlow 的 make_csv_dataset 的东西可以与字符串变量一起使用?
- nlp - IBM 自然语言处理项目(初学者入门问题)