Bug 31583 - ListView inside MasterDetailPage select item and scroll issues
Summary: ListView inside MasterDetailPage select item and scroll issues
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.4
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-07-02 12:39 UTC by Alexander
Modified: 2016-04-11 02:54 UTC (History)
3 users (show)

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

Repro (275.92 KB, application/x-zip-compressed)
2015-07-09 18:34 UTC, Chris King

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:

Description Alexander 2015-07-02 12:39:38 UTC
Update to Xamarin Forms

In MasterDetailPage set Master = ContentPage { Content = ListView {...} }

BUG #1: On Android when I'm tapping item#1 of this ListView it's highlights but then selects lower item (item#2).
Same thing with any item: it's always highlights and then selects lower item.

BUG #2: If I set ListView.Header = new Image {...}, then on Android when I scroll this ListView the image is jumping and showing parallax effect.

Sorry 4 bad english.
Comment 1 Chris King 2015-07-09 18:34:49 UTC
Created attachment 11963 [details]

I show no repro
Comment 2 Chris King 2015-07-09 18:35:43 UTC
Thanks for submitting the bug. I am unable to reproduce the behavior you describe on the latest version of forms. Please submit reproductions if you are still seeing odd behavior. Please open separate bugs for separate issue.

Warm regards,
Xamarin Forms Team
Comment 3 Hans 2015-07-09 23:59:41 UTC
We encountered this bug as well. I don't have a code snippet to reproduce it, but somebody posted some on the Xamarin Forums: https://forums.xamarin.com/discussion/44672/off-by-one-error-when-setting-listview-itemssource
Comment 4 Hans 2015-07-10 00:06:23 UTC
(The aforementioned post mentions: "If you try the repro code below, the alert will show "2" when you click on the row for item 1. If you move the line of code setting the ItemsSource into the constructor, then you will get the correct behavior." The code you attached sets the ItemsSource in the constructor, so everything works correctly. The problem occurs when settings the ItemsSource afterwards, which is also what we do in our app. Unfortunately we cannot move said code into the constructor, since we set the ItemsSource dynamically, based on certain user actions.)
Comment 5 Alexander 2015-07-10 03:49:36 UTC
Thanks to Hans and Chris for the replies. Today I found that this strange behaviour appears only if I set ItemsSource asynchronously.

Here is my code:

			GetMenuItemsAsync().ContinueWith((t) => {
				Device.BeginInvokeOnMainThread(() => {
					listView.ItemsSource = t.Result;

In previous version of Forms everything was fine.
Comment 6 Jason Smith [MSFT] 2016-04-11 02:54:12 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team