I would like to remove default behaviour on the ListView on iOS - highlight items on tap. I tried with setting the background color. And it didn't work out. I found this issue on github https://github.com/NativeScript/NativeScript/issues/455 however I don't know how to achieve this in Angular nativescript
Set the itemLoading event on the list view like this:
<ListView [items]="items" (itemLoading)="onItemLoading($event)">
Then in your typescript, define your onItemLoading event like this:
import { isIOS } from 'tns-core-modules/platform';
declare var UITableViewCellSelectionStyle;
// ...
onItemLoading(args: ItemEventData) {
if (isIOS) {
const iosCell = args.ios;
iosCell.selectionStyle = UITableViewCellSelectionStyle.None;
}
}
FYI - I tested this on nativescript-angular version 3.1.0 and tns-core-modules version 3.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With