Skip to content

CollectionView.Header is header is not scrollable in Android platform. #22120

@ghost

Description

Description

Content in the CollectionView.Header is not Scrollable.

Code snippet:

     <local:ItemInfo/>
 </ContentPage.BindingContext>
 <CollectionView
     x:Name="collectionView"
     Margin="40"
     HorizontalOptions="Fill"
     ItemsLayout="VerticalGrid, 3"
     VerticalOptions="Fill">
     <CollectionView.Header>
         <ScrollView>
             <ListView x:Name="listView"  HorizontalOptions="Center" 
                ItemsSource="{Binding DataSource}" />
         </ScrollView>
     </CollectionView.Header>
     <CollectionView.ItemTemplate>
         <DataTemplate>
             <Button
                 x:Name="grid"
                 Margin="5"
                 Padding="0"
                 HeightRequest="60"
                 HorizontalOptions="Fill"
                 Text="{Binding .}"
                 VerticalOptions="Center" />
         </DataTemplate>
     </CollectionView.ItemTemplate>
 </CollectionView>
	public MainPage()
	{
		InitializeComponent();
        collectionView.ItemsSource = new ItemInfo().DataSource;
    }

    public class ItemInfo
    {
        private ObservableCollection<object> dataSource = new ObservableCollection<object>()
        {
            "Pink", "Green", "Blue", "Yellow", "Orange", "Purple", "SkyBlue", "PaleGreen"
        };

        public ObservableCollection<object> DataSource
        {
            get => dataSource;
            set => dataSource = value;
        }

        public ItemInfo()
        {

        }
    }

ScrollingIssue.zip

Steps to Reproduce

  1. Run the attached sample.
  2. Scroll the Collection view header to view remaining items.
  3. Unable to scroll.

Link to public reproduction project repository

ScrollingIssue.zip

Version with bug

Unknown/Other

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions