Search code examples
nativescriptangular2-nativescriptnativescript-angular

Nativescript RadListView multiple selection: how to remove default style?


I'm using RadListView to create a multiple selection on IOS.

In front of the selection item somehow there is a circle checkbox I couldn't remove, which looks like: enter image description here

My codes are:

<RadListView [items]="items" selectionBehavior="Press" multipleSelection="true" height="80%">
    <ng-template let-item="item">
         <Label [text]="item.name"></Label>
    </ng-template>
</RadListView>

and:

this.items = [{ name: 'test1' }, { name: 'test2' }, { name: 'test3' }];

Anyone got an idea?


Solution

  • On iOS, those checkboxes appear beside your label is the only way user would distinguish between selected & unselected items.

    You may apply padding only for iOS to prevent overlapping,

    <RadListView [items]="items" selectionBehavior="Press" multipleSelection="true" height="80%">
        <ng-template let-item="item">
             <Label ios:paddingLeft="50" [text]="item.name"></Label>
        </ng-template>
    </RadListView>
    

    If you still prefer a different style for selection, you will have to build your own, you may have a selected flag in each data item and toggle them upon tapping list item and update your CSS (may be background-color) for list item based on the selected flag.