Xamarin.forms: [Bug] [iOS] Horizontal Collection View Item Spacing Hiding Items

Created on 20 Sep 2019  路  10Comments  路  Source: xamarin/Xamarin.Forms

Description

When using a horizontal orientated collection view with an item spacing then some items are hidden.

Steps to Reproduce

  1. Use Xaml below, AList is a string[6]
  2. Run, 3 items are shown
  3. Remove ItemSpacing, rerun and 6 items are shown

            <CollectionView ItemsSource="{Binding AList}">
    
                <CollectionView.ItemsLayout>
                    <ListItemsLayout ItemSpacing="15" Orientation="Horizontal" />
                </CollectionView.ItemsLayout>
    
                <CollectionView.ItemTemplate>
                    <DataTemplate>
    
                        <Label Text="O" TextColor="Blue" />
    
                    </DataTemplate>
                </CollectionView.ItemTemplate>
    
            </CollectionView>
    

Expected Behavior

6 items always shown

Actual Behavior

only 3 shown (changing the items spacing effects the number of items)

Basic Information

  • Version with issue:
    4.2.0.815419
  • Last known good version: unknown
  • IDE:
  • Platform Target Frameworks:

    • iOS: 12.4

    • Android: not tested

    • UWP: not tested

  • Android Support Library Version: not tested
  • Nuget Packages: n/a
  • Affected Devices:
    iOS 6s Simulator

Screenshots

will provide if needed

Reproduction Link

will provide if needed

collectionview iOS 馃崕 bug

Most helpful comment

Facing this issue here in my horizontal list with item spacing. If I remove the spacing that works nicely.

All 10 comments

@paul-charlton It'd be easier for the team if you could attach a repro.

Reproduction Link

will provide if needed

most definitely needed

/cc @hartez @rmarinho

there's a branch here that shows the problem. The top collection view only shows 3 items, the second one (which is working) shows 6.

https://github.com/paul-charlton/IssueSandbox/tree/XF_7605

the same issue seems to occur if you use a gridlayout with spacing as well:
<GridItemsLayout HorizontalItemSpacing="15" Orientation="Horizontal" Span="1" />

Facing this issue here in my horizontal list with item spacing. If I remove the spacing that works nicely.

I'm facing this issue as well, removing the ItemSpacing fixes it

Any updates on this one?

This is still an issue. Can this get some love please?

Was this page helpful?
0 / 5 - 0 ratings