Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemSpacing value seems to be ignored. #31

Closed
occcy opened this issue Jul 9, 2021 · 1 comment
Closed

ItemSpacing value seems to be ignored. #31

occcy opened this issue Jul 9, 2021 · 1 comment

Comments

@occcy
Copy link

occcy commented Jul 9, 2021

Platform

  • OS: Android
  • Device: AndroidEmulator / Huawei P Smart 2019
  • Sdk vervion: Android SDK 29
  • Xamarin.Forms: 5.0

Describe the bug
The value of ItemSpacing is set to 0 but there is still space between the cells.

To Reproduce
xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
			 xmlns:sh="http://sharpnado.com"
			 x:Class="Test.TestPAge">
	<ContentPage.Resources>
		<DataTemplate x:Key="CellTemplate">
			<ViewCell>
				<Label BackgroundColor="LightCoral"
					   TextColor="Black"
					   Margin="0"
					   Padding="0"
					   HeightRequest="40"
					   Text="{Binding .}"
					   HorizontalOptions="FillAndExpand"
					   VerticalOptions="FillAndExpand" />
			</ViewCell>			
		</DataTemplate>
	</ContentPage.Resources>
    <ContentPage.Content>
		<AbsoluteLayout BackgroundColor="White">
			<sh:HorizontalListView x:Name="listview"
								   ItemHeight="40"
								   ItemTemplate="{StaticResource CellTemplate}"
								   ItemSpacing="0"
								   BackgroundColor="LightSeaGreen"
								   HorizontalOptions="FillAndExpand"
								   VerticalOptions="FillAndExpand"
								   ListLayout="Vertical"
								   AbsoluteLayout.LayoutFlags="All"
								   AbsoluteLayout.LayoutBounds="0,0,1,1" />
		</AbsoluteLayout>
	</ContentPage.Content>
</ContentPage>

codebehind:

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace Test {
	[XamlCompilation(XamlCompilationOptions.Compile)]
	public partial class TestPAge : ContentPage {
		public TestPAge() {
			InitializeComponent();
			listview.ItemsSource = new[] { "Eintrag 1", "Eintrag 2", "Eintrag 3", "Eintrag 4" };
		}
	}
}

Screenshots
image

@roubachof
Copy link
Owner

should go away with next version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants