[Question] Strange padding in a nasted CollectionView, how to remove?

BadStormBadStorm ITMember ✭✭

Hi,
i created a simple project with a MainPage that contains a CollectionView with a CustomView as DataTamplate. In this view there is a second CollectionView. The CollectionView is the root element for teh page andhe for the view too. All works, except a strange padding/margin (Top,Left) that I cannot remove.

The problem is present on all the pltaforms (iOS, Android and UWP).

Any ideas?

Thanks in advance!

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai

    I create a basic sample to test CollectionView and set ContentView as DataTamplate. The code deploys well and there is no strang padding.

    How did you test the view? Could you post the related code for test?

    <CollectionView x:Name="collectionView" ... ItemsSource="{Binding Monkeys}">
        <CollectionView.ItemTemplate>
            <DataTemplate>
                <ContentView BackgroundColor="Red">
                    ...
                </ContentView>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>
    

  • BadStormBadStorm ITMember ✭✭

    Thanks @Jarvan. Here I publish my example project that show the problem:
    https://github.com/badstorm/xamarin_forms_collectionview_bug

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited February 17

    Hi, I download the sample and deploy the code on my side. But the code of the views doesn't contains the CollectionView, please check if the link is correct.

  • BadStormBadStorm ITMember ✭✭

    You are right @Jarvan, my fault. The code is correct the problem is on the CarouselView, but since is based on CollectionView I wrongly wrote Collection instead of Carousel.

    I tried to rename the title of this thread but i cannot find a way...

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited February 18

    I tested the demo on my side which works fine as shown. Did not encounter the problem you described.

    I tried to rename the title of this thread but i cannot find a way...

    Click the options menu to edit the content.

  • BadStormBadStorm ITMember ✭✭
    edited February 18

    I tested today with the last xamarin forms (4.4.0.991640). On Android now works but on iOS the problem remain:


    @Jarvan on my side there is no option menu on this thread, there is only the star. Maybe there is a time limit?

  • JarvanJarvan Member, Xamarin Team Xamurai

    On Android now works but on iOS the problem remain:

    I've tested the issue on ios, the padding exists. This may be a potential issue and you can report the issue to the product team on github.

  • BadStormBadStorm ITMember ✭✭

    Thanks Jarvan, I opened here the github issue

Sign In or Register to comment.