Bug 42132 - ListView ViewCell doesn't FillAndExpand cells with Frame
Summary: ListView ViewCell doesn't FillAndExpand cells with Frame
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-06-23 21:17 UTC by Pablo Biagioli
Modified: 2016-08-09 14:19 UTC (History)
2 users (show)

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

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 Pablo Biagioli 2016-06-23 21:17:53 UTC
I have a List view, with a GroupHeader and CardViews wrapped in Frames. The Frames are used for displaying a red or gray border in order to let the user know if there's an error with that list entry.

I had to put WidthRequest="5000" to the View inside the Frame Element to make the Cell's width FillAndExpand.

I believe this is an issue with the ListView or the Frame Element. This issue appeared for me from Xamarin.Forms, but now I upgraded to XF

Below is the ListView's code

Thanks in advance


	ItemsSource="{Binding GroupedLocationsList, Mode=TwoWay}"
	SelectedItem="{Binding ItemSelected, Mode=TwoWay}"
	BackgroundColor="{x:Static Core:ColorResources.LightGrayColor}"
	GroupDisplayBinding="{Binding GroupName}"
			<ViewCell StyleId="LocationListGroup">
				<StackLayout Orientation="Vertical" HorizontalOptions="CenterAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="{x:Static Core:ColorResources.LightGrayColor}" Padding="0,0,0,0" HeightRequest="30">
					<Label Text="{Binding GroupName}" VerticalOptions="CenterAndExpand" Style="{StaticResource LabelSettingsTitle}"></Label>
			<ViewCell StyleId="LocationListItem">
				<StackLayout Orientation="Vertical" HorizontalOptions="CenterAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="{x:Static Core:ColorResources.LightGrayColor}" Padding="0,3,0,3" HeightRequest="60">
					<Frame VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Padding="1" BackgroundColor="{Binding ErrorBorderColor}" HasShadow="False">
						<customControls:SettingsCardForm VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" WidthRequest="5000" BorderColor="{Binding ErrorBorderColor}" BackgroundColor="White">
							<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="5">
								<Image VerticalOptions="Center" Source="{Binding UserLocationType, Converter={StaticResource locationListItemTypeImageConverter},ConverterParameter=0}"></Image>
								<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" Padding="0">
									<Label Text="{Binding Name, Converter={StaticResource elipsizerConverter},ConverterParameter=30}" HorizontalOptions="StartAndExpand" Style="{StaticResource LabelFieldValue}"/>
										Text="{Binding Address, Converter={StaticResource elipsizerConverter},ConverterParameter=30}"
										Style="{StaticResource LabelFieldTitle}"
										IsVisible="{Binding Address, Converter={StaticResource locationListItemAddressVisibilityConverter},ConverterParameter=0}"/>
								<Image VerticalOptions="Center" Source="{Binding ErrorImage}" HeightRequest="30" WidthRequest="30"></Image>
								<Image HorizontalOptions="End" VerticalOptions="Center" Source="GreyRightArrow.png" HeightRequest="25" WidthRequest="25"></Image>
Comment 1 Pablo Biagioli 2016-06-23 21:30:29 UTC
Apparently the ListView works fine with Xamarin.Forms and doesn't need the WidthRequest=5000 in the CardView.

Thanks in advance
Comment 2 Rui Marinho 2016-08-09 14:19:28 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