Android 在点击Nativescript Angular+;时删除ListView项高亮显示;行分隔符颜色?
现在是2020年12月,人们仍然很难消除它在Android 在点击Nativescript Angular+;时删除ListView项高亮显示;行分隔符颜色?,android,ios,angular,nativescript,Android,Ios,Angular,Nativescript,现在是2020年12月,人们仍然很难消除它在ListView和LineSeparator上造成的突出显示效果。 我正在使用Angular+Nativescript 这是删除点击突出显示的iOS解决方案,它是这样工作的: onItemLoading(args: ItemEventData) { if (isIOS) { var cell = args.ios; cell.selectionStyle = UITableViewCellSelectionSty
ListView
和LineSeparator
上造成的突出显示效果。
我正在使用Angular
+Nativescript
这是删除点击突出显示的iOS
解决方案,它是这样工作的:
onItemLoading(args: ItemEventData) {
if (isIOS) {
var cell = args.ios;
cell.selectionStyle = UITableViewCellSelectionStyle.UITableViewCellSelectionStyleNone;
}
}
Android问题:如何使用Android实现这一点?Android和iOS问题:如何从
列表视图中删除分隔线
颜色?
这是我的tns信息
:
Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.8.0 and the latest available version is 7.0.12.
✔ Component tns-core-modules has 6.6.0-next-2020-05-08-112112-01 version and is up to date.
✔ Component tns-android has 6.5.3 version and is up to date.
⚠ Update available for component tns-ios. Your current version is 6.5.2 and the latest available version is 6.5.3.
非常感谢大家。要删除android上的highlight/ripple,您可以连接到
列表视图的loaded
事件,并设置一些android属性,如下所示:
对于分隔符颜色,您应该能够直接在html中或通过css使用separatorColor
属性:
ListView{
分隔颜色:透明;
}
AboutseparatorColor
。这是我第一次尝试但没有成功的方法。所有这些方法都不起作用,因为我已经安装了RadDataForm
组件。。。似乎这个组件还在整个应用程序中添加了分隔符行…感谢您回复Listview
。这很有效。谢谢。无论如何,我已经向Nativescript开发人员提出了一个问题:这将帮助所有人。无论如何谢谢你的帮助!
declare const android;
onLoaded(event) {
if (event.object.android) {
event.object.android.setSelector(new android.graphics.drawable.StateListDrawable());
}
}