This is a migrated thread and some comments may be shown as answers.

ListView - LongPress and UIMenuController

4 Answers 154 Views
ListView - Xamarin.iOS
This is a migrated thread and some comments may be shown as answers.
Josian
Top achievements
Rank 1
Josian asked on 13 Jun 2016, 02:34 PM

Hi,

I have 2 questions about TKListView :

1 - Is it possible to keep both behaviours LongPress and Press on a listView cell ?

I want a "normal" action on Press and a "Special' action on the long press (which will be described in point 2)

 

2 - So the action i want on long press is displaying a custom context menu (UIMenuController) with my own set of actions.

 

Can TKListView answer YES and if so, HOW to my questions ?

 

Regards,

4 Answers, 1 is accepted

Sort by
0
Josian
Top achievements
Rank 1
answered on 15 Jun 2016, 07:48 AM

Hi,

Is there a follow-up on this forum ?

Best Regards,

0
Deyan
Telerik team
answered on 15 Jun 2016, 08:28 AM
Hello Josian,

As the documentation states, there are two callbacks that can be used in this scenario:

http://docs.telerik.com/devtools/ios/api/Protocols/TKListViewDelegate.html

– listView:didLongPressCell:atIndexPath:
– listView:didSelectItemAtIndexPath:

Do they not work for you?

Regards,
Deyan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Josian
Top achievements
Rank 1
answered on 15 Jun 2016, 08:42 AM

thank you for your answer....

 

I read and tried this scenario but the problem is the  TKListViewSelectionBehavior  has only 3 options :

- None,
- Press => fires the – listView:didSelectItemAtIndexPath:
- LongPress => fires the – listView:didLongPressCell:atIndexPath: and then the – listView:didSelectItemAtIndexPath:

I can't choose to keep both Press AND LongPress action...

 

What i need is : Being able to set the TKListViewSelectionBehavior to Press AND LongPress with this behavior :

- Press : fires the – listView:didSelectItemAtIndexPath:

- LongPress => fires the – listView:didLongPressCell:atIndexPath:

 

Regards,

 

 

0
Deyan
Telerik team
answered on 17 Jun 2016, 01:20 PM
Hi Josian,

Thanks. I now have better understanding of the scenario.

In your case my suggestion would be to use the Press selection mode and additionally implement the LongPress functionality by following the instructions in this post on StackOverflow:

http://stackoverflow.com/questions/18848725/long-press-gesture-on-uicollectionviewcell


Regards,

Deyan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

 
Tags
ListView - Xamarin.iOS
Asked by
Josian
Top achievements
Rank 1
Answers by
Josian
Top achievements
Rank 1
Deyan
Telerik team
Share this question
or