_From @relez on June 6, 2018 19:16_
Hi guys, I am facing an issue on Android where the Swipe actions are not working, I have tried the same code in iOS and works perfect, I have checked the examples and looks I am not missing anything. Here is my RadListView declaration:
<RadListView #orderItemsListview row="1" height="100%" [items]="_order.getMobileOrderTypeItems()" class="" (itemTap)="onOrderItemListTap($event)" swipeActions="true">
<ng-template tkListItemTemplate let-item="item">
<GridLayout class="item background-main-color top-left-rounded top-right-rounded bot-left-rounded bot-right-rounded" columns="*, 50" rows="65">
<StackLayout col="0" class="" style="vertical-align:center;">
<Label [text]="item.Description" class="font-18 font-bold" textWrap="true" style=""></Label>
</StackLayout>
<StackLayout col="1" class="" style="vertical-align:center;text-align:center;color:white;">
<Label class="fa font-16" text=""></Label>
</StackLayout>
</GridLayout>
</ng-template>
<StackLayout *tkListItemSwipeTemplate height="65" style="padding:0 10 0 10;background-color:red;vertical-align:center;" class="item item-rounded top-right-rounded top-left-rounded bot-right-rounded bot-left-rounded" (tap)="onRemoveOrderItemTap($event)">
<Label text="Remove from this Order" class="item-swipe-action font-14" horizontalAlignment="center"></Label>
</StackLayout>
</RadListView>
Thanks!
_Copied from original issue: NativeScript/nativescript-angular#1368_
Hi @relez,
tested the Swipe action functionality with the sample project here, however, I was unable to recreate any issue.
Please provide sample project, which could be used for debugging.
Hi, I have attached a sample project for you to test, the swipe actions are working in iOS but not in Android
HI @relez,
The layout's backgroundColor, which is used for the ng-template is transparent by design in Android. Regarding that, you should set up the background colour. For example:
<ng-template tkListItemTemplate let-item="item">
<GridLayout backgroundColor="white" class="" columns="*" rows="65">
<StackLayout col="0" class="" style="vertical-align:center;">
<Label [text]="item.name" class="" textWrap="true"></Label>
</StackLayout>
</GridLayout>
</ng-template>
Also, you can review how the Layout for the swipe option is defined in our sample app.
I tried to set background color, and everything that i see in the docs and examples and i don't get it to work in Android 7.1.0.
@tsonevn approach didn't work for me at all, actually I am not using this feature on Android. Hopefully they find out there is something going on.