iphone – Scrolling on iOS doesn’t work correctly with two CollectionViews in a single ScrollView

iphone – Scrolling on iOS doesn’t work correctly with two CollectionViews in a single ScrollView


I’m creating an app in .NET MAUI and I’ve the next challenge. I’ve two collections of things in my View Mannequin. Every assortment is sure to a unique CollectionView having their very own header management. In regular circumstances, there will probably be extra complete gadgets in these collections than I can show directly. So, every thing is in a ScrollView.

Within the following description I assume all parts of the primary assortment are displayed, however solely a part of the second assortment, i.e. the primary CollectionView is totally displayed, the second isn’t.

Android

Every little thing is superior and works as anticipated. I’ve two collections and after I scroll from wherever, I scroll. Superior.

iOS

If I begin the scrolling my having my finger within the first CollectionView, any SectionHeader or outdoors the second CollectionView, I can scroll the web page completely. Nonetheless, if I put my finger on the second CollectionView and transfer it, it appears to be like prefer it tries to scroll solely the second CollectionView and the remainder of the web page stays in place. As soon as I obtained it to scrolling, scrolling works from wherever.

Code

<ScrollView>
    <VerticalStackLayout Margin="10">
        <controls:SectionHeader BindingContext="{Binding Path=Caption1}"
                                Margin="0,0,0,5" />

        <CollectionView x:Title="SearchResultsCollectionView"
                        ItemsSource="{Binding Path=Items1}"
                        ItemsLayout="VerticalList">
            <CollectionView.ItemTemplate>
                <DataTemplate x:DataType="viewModels:FirstViewModel">
                    <!-- Correct implementation of my knowledge template -->
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>

        <controls:SectionHeader BindingContext="{Binding Path=Caption2}"
                                Margin="0,10,0,5" />

        <CollectionView x:Title="TodaysEventsCollectionView"
                        ItemsSource="{Binding Path=Items2}"
                        ItemsLayout="VerticalList">
            <CollectionView.ItemTemplate>
                <DataTemplate x:DataType="viewModels:SecondViewModel">
                    <!-- Correct implementation of my different knowledge template -->
                </DataTemplate>
            </CollectionView.ItemTemplate>
        </CollectionView>

        <controls:Button Margin="0,5,0,0"
                         BindingContext="{Binding Path=MyButton}" />
    </VerticalStackLayout>
</ScrollView>

What can I do?

Once more, this solely occurs on iOS (I’m utilizing an iOS 17.5 system for improvement) and solely at first for the second CollectionView, however it’s a damaging consumer expertise and I want to repair it.

author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 
rooshohttps://www.roosho.com
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here


Latest Articles

author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog.