Bug 31816 - Gap between Header and contents of listview increases every time listview is displayed via IsVisible. New in XF 1.4.3
Summary: Gap between Header and contents of listview increases every time listview is ...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: Other Other
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-10 06:07 UTC by RogerH
Modified: 2015-07-21 12:51 UTC (History)
5 users (show)

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


Attachments
SampleProject (183.01 KB, application/zip)
2015-07-10 07:08 UTC, Parmendra Kumar
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:
VERIFIED FIXED

Description RogerH 2015-07-10 06:07:41 UTC
I have two ListViews on a page. I use .IsVisible() to show one or the other.

When I toggle between ListViews the gap between the Listview Header and the ListView contents increases all by itself.
I have a small sample test program to show this (pasted below)

How to Repoduce.
Run the Program. It says CLICK ME at the top.
When you click the button the Listview containing aa,bb,cc... is replaced by one containing 11,22,33..
Click the button again and it toggles back to aa,bb,cc.
Keep doing this 5 or 6 times and you will see the gap between HEADER and CONTENTS increases.

Example of what the screen looks like
On launch

///////////////////
/    CLICK ME     /
/ HEADER 1        /
/ aa              /
/ ---             /
/ bb              /
/ ---             /
/ cc              /
/ ---             /
/ dd              /
/ ---             /
///////////////////


After several clicks on CLICK ME button you have this display

///////////////////
/    CLICK ME     /
/ HEADER 1        /
/                 /   <- notice the gap that appears here
/                 /
/ aa              /
/ ---             /
/ bb              /
/ ---             /
/ cc              /
/ ---             /
/ dd              /
/ ---             /
///////////////////







using System;

using Xamarin.Forms;

namespace HeaderBug143
{
	public class App : Application
	{
		public App ()
		{


			// The root page of your application
			var listview1 = new ListView();
			listview1.ItemsSource = new String[] {"aa","bb","cc","dd","ee","ff"};
			listview1.Header = "header 1";

			var listview2 = new ListView();
			listview2.ItemsSource = new String[] {"11","22","33","44","55","66"};
			listview2.Header = "header 2";

			var button = new Button();
			button.Text = "Click me";
			button.Clicked += (object sender, EventArgs e) => {
				// Toggle listview IsVisible()
				if (listview1.IsVisible == true) {
					listview1.IsVisible = false;
					listview2.IsVisible = true;
				} else {
					listview1.IsVisible = true;
					listview2.IsVisible = false;
				}
			};

			MainPage = new ContentPage {
				Content = new StackLayout {
					VerticalOptions = LayoutOptions.StartAndExpand,
					Children = {
						button,
						listview1, listview2
					}
				}
			};
			// initialise
			listview1.IsVisible = true;
			listview2.IsVisible = false;
		}


	}
}






Did not do this in Xamarin Forms 1.4.2 on iOS.
However that version had its own issue with IsVisible() where it would regularly fail to display the ListView



Xamarin Forms 1.4.3.6376

Xamarin.iOS
Version: 8.10.2.37 (Indie Edition)
Comment 1 Parmendra Kumar 2015-07-10 07:08:16 UTC
Created attachment 11970 [details]
SampleProject

I have tried to reproduce this issue and observed that I am getting same behavior mentioned in bug description on iOS and on Android its working fine.

Screencast: http://www.screencast.com/t/3mxYQzUTZ

Application Output: https://gist.github.com/Parmendrak/406040e9b654071f7cae
IdeLog: https://gist.githubusercontent.com/Parmendrak/169e530fa06fde0038dc/raw/IDELog
Simulator Log: https://gist.github.com/Parmendrak/bcda23702f7086dea6e2

Environment info:

Xamarin.Forms: 1.4.3.6376
Xamarin Studio  5.9.4 (build 5)
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400020005
Xcode 6.2 (6776)
Xamarin.iOS : 8.10.2.43 (Enterprise Edition)
Xamarin.Android : 5.1.4.16 (Enterprise Edition)
Mac OS X 10.9.4
Comment 2 Jason Smith [MSFT] 2015-07-16 17:40:18 UTC
This should be fixed in 1.4.4-pre1
Comment 3 Parmendra Kumar 2015-07-21 12:51:43 UTC
I have checked this issue with Xamarin.Forms 1.4.4-pre3 and its working fine at my end.


Hence closing this issue.


Thanks!!