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

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

Open
IndumathiR-1995 opened this issue Apr 29, 2024 · 2 comments
Open
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@IndumathiR-1995
Copy link

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

@IndumathiR-1995 IndumathiR-1995 added the t/bug Something isn't working label Apr 29, 2024
@jsuarezruiz jsuarezruiz added area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 labels Apr 29, 2024
@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 6, 2024
@Zhanglirong-Winnie
Copy link
Collaborator

Zhanglirong-Winnie commented May 6, 2024

Verified this issue with Visual Studio 17.10 Preview 6.0 (8.0.21). Can repro on android platform with sample project.

@TalionOak
Copy link

Isn't it better if you do it this way?

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="ScrollingIssue.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:local="clr-namespace:ScrollingIssue">
    <ContentPage.BindingContext>
        <local:ItemInfo />
    </ContentPage.BindingContext>

    <Grid RowDefinitions="300,*">
        <ListView
            x:Name="listView"
            Grid.Row="0"
            ItemsSource="{Binding DataSource}" />
        <CollectionView
            x:Name="collectionView"
            Grid.Row="1"
            Margin="40"
            ItemsLayout="VerticalGrid, 3">
            <CollectionView.ItemTemplate>
                <DataTemplate>
                    <Button
                        x:Name="grid"
                        Margin="5"
                        Padding="0"
                        HeightRequest="60"
                        HorizontalOptions="Fill"
                        Text="{Binding .}"
                        VerticalOptions="Center" />
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>
    </Grid>
</ContentPage>

I don't think Header should be Scrollable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants