Bug 24476 - Windows Phone loses styles when adding a ListView to StackLayout
Summary: Windows Phone loses styles when adding a ListView to StackLayout
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-12 15:23 UTC by Jon Douglas [MSFT]
Modified: 2015-06-02 05:38 UTC (History)
5 users (show)

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


Attachments
Reproduction (6.06 MB, application/zip)
2014-11-12 15:23 UTC, Jon Douglas [MSFT]
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 FIXED

Description Jon Douglas [MSFT] 2014-11-12 15:23:30 UTC
Created attachment 8706 [details]
Reproduction

From a customer:

When I add a basic listview to the screen I am working on, it looks as
expected on iOS and Android, but on Windows Phone it turns the background
color of my entire view black, and adds a lot of extra scrolling space.

This is the only code I added to my view:

var listView = new ListView();

listView.ItemsSource = new string[]
{
"item 1",
"item 2",
"item 3",
"item 4"
};

stackMain.Children.Add(listView);

http://www.screencast.com/t/iM4mtC1A2n

which makes it go from this (left) to this (right).

I've created a reproduction attached with a few comments in the QuotePage.cs to show the differences.
Comment 1 Jason Smith [MSFT] 2014-12-10 08:32:23 UTC
This behavior has changed in 1.3.0, please revalidate.
Comment 2 Jason Smith [MSFT] 2014-12-10 08:32:46 UTC
The changes were to deal with this kind of issue :)
Comment 3 Ram Chandra 2015-01-05 13:25:10 UTC
I have checked this and I am also able to reproduce this issue.

When I deploy the attached project I observed that in windows emulator it turns the background color of entire view black, and adds a lot of extra scrolling space. I also observed that after upgrading to Xamarin.Forms.1.3.0.6292 the background color of view is working fine but the scrolling problem is still exists.

Screencast1 (Xamarin.Forms.1.0.6186) : http://www.screencast.com/t/jTvZcAMB
Screencast2 (Xamarin.Forms.1.3.0.6292) : http://www.screencast.com/t/12pQ5k5V

Debug logs: https://gist.github.com/RamChBachkheti/5e2d18a287923cd49c1b

Please let me know if I can provide more info to this issue.

Environment Info: 

Xamarin.Forms.1.3.0.6292
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
Xamarin   3.8.150.0 (10cfd178d55287f09c85f5a1e604dfe20889a40f)
Xamarin.Android   4.20.0.28 (ba9bbbdd44cfdc4bf485e8885bd2ad24fba525f7)
Xamarin.iOS   8.4.0.0 (840a925103a0bf4a856507f13d5eaee3c1579c2f)
Xamarin.iOS Unified Migration   1.0