Xamarin.Forms - Display all items without scrolling

RedZ

Im using a scrollview to display my homepage, it contains many controls, including 2 CollectionViews, my problem is that when the user is scrolling down the home page, and once the CollectionView is reached, he will get stuck in the CollectionView's scroller, i want all the items (about 40 items) shown in the CollectionView without the scroller so that the user can keep scrolling the homepage and through the CollectionView's items towards the controls bellow. I have tried to set a fixed height for the CollectionView but that didnt work. Also, i found an article talking about using a BindableLayout, but i read somewhere that it can be much slower than CollectionView and it doesnt support the item layout (im using span="2" to show 2 items next to each other on each row)

Lucas Zhang - MSFT

You could use BindableLayout of FlexLayout . Check the following code

<ScrollView Orientation="Vertical" BackgroundColor="LightBlue">

        //.. other elements
 
        <FlexLayout  BindableLayout.ItemsSource="{Binding XXX}" Direction="Row"
                AlignItems="Start" Wrap="Wrap" JustifyContent="SpaceAround" AlignContent="SpaceAround" >
            <BindableLayout.ItemTemplate>
                <DataTemplate>

                   //replace it with your data template
                    <StackLayout HeightRequest="100" WidthRequest="180" BackgroundColor="Red" Margin="10"  >

                        <Label Text="{Binding .}" TextColor="Black" BackgroundColor="Green" /> 

                    </StackLayout>

                </DataTemplate>
            </BindableLayout.ItemTemplate>
        </FlexLayout>

    </ScrollView> 

Note:

In this way you need to set the width of each item less than half of the width of screen . Otherwise the item will warp to the next row .

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

display all textarea rows without scrolling

How can I display a nested list of items in Xamarin Forms?

Xamarin.Forms: Get all cells/items of a listview

Scrolling to start of Xamarin Forms ListView with header

Magnification of items during scrolling in Xamarin.Forms

How can I display items in a ListView horizontally in Xamarin.forms xaml?

How to display items from different types in a Table in Xamarin Forms

Xamarin forms: Load more items without button click

Xamarin Forms: Multiple items for a converter

Xamarin Forms AutomationId on ListView items

ListView set height to show all items without scrolling

Xamarin.forms - "Affix" StackLayout when scrolling

Xamarin Forms: How to select all items from local DB in the sorted order of time

WPF Compobox - how to display entire content of the two items without scrolling?

Xamarin Forms - xamarin forms navigation bar scrolling on Android

How to display single listview items in 2 columns and n number of rows in Xamarin Forms

Detect scrolling ended in Xamarin.Forms.Scrollview

Xamarin Forms UWP - Display PDF

Display images on listView without scrolling?

cannot display image in xamarin forms

Display text with icon in Xamarin forms

How to generate listview as shown in Paint Image using Xamarin Forms, Example display shopping Items

Xamarin.Forms Scrolling Grid With Relative Sizes

Xamarin forms Scrolling not working with PullToRefreshLayout in table view

How to display ListView on top of (over the) other items in Xamarin Forms?

CollectionView disabling scrolling in Xamarin forms

Xamarin forms display an image issue

How can I display items of Collection View one by one in Xamarin Forms?

Recyclerview - Loading all items without scrolling

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive