Bug 33530 - ListView.ItemTapped event is not fired in iOS if UITableView.Scrolled event is subscribed
Summary: ListView.ItemTapped event is not fired in iOS if UITableView.Scrolled event i...
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.5.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-01 06:34 UTC by ondrej.kanecka
Modified: 2015-09-30 06:18 UTC (History)
2 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
Xamarin Studio simple project (6.90 MB, application/zip)
2015-09-01 06:34 UTC, ondrej.kanecka
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description ondrej.kanecka 2015-09-01 06:34:10 UTC
Created attachment 12700 [details]
Xamarin Studio simple project

Create a iOS custom renderer for Xamarin.Forms.ListView that inherits from ListViewRenderer class. Inside the method OnElementChanged subscribe for event Scrolled (or similar events like DraggingEnded or DecelerationEnded) of the Control (the Control is of type UITableView). There is an event in Xamarin.Forms.ListView called ItemTapped. This event is no longer fired due to Scrolled event subscription in the custom renderer.
Simple project is attached that demonstrates this behavior.
Comment 1 Rui Marinho 2015-09-30 06:18:08 UTC
Hi, this isn't a bug , when you try run the sample you get this exception:

"Event registration is overwriting existing delegate. Either just use events or your own delegate: Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource UIKit.UIScrollView+_UIScrollViewDelegate"

What's happening is Xamarin.Forms ListViewRenderer is setting a DataSource to the UITablewView that has it's own UISCrollViewDelegate, this means you can't subscribe to the Scrolled event since there's already a delegate.