Coder Social home page Coder Social logo

syncfusionexamples / xamarin.forms-listview-inside-scrollview Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 514 KB

Sample showcases how to load Xamarin.Forms Listview inside Scrollview.

C# 100.00%
sflistview scrollview xamarin xamarin-forms xamarin-android xamarin-ios listview xamarin-uwp xamarin-listview

xamarin.forms-listview-inside-scrollview's Introduction

Loading Xamarin.Forms ListView inside ScrollView

When the SfListView is loaded inside the ScrollView with the height of total items, scrolling will not occur in the SfListView only when AllowSwiping is set to true. The SfListView does not pass touch to the parent ScrollView in UWP, because swiping is handled in it.

When the SfListView is loaded inside the ScrollView the following scenarios, the height of the total items is set to HeightRequest of the SfListView.

If the position of the SfListView is not in view when loading inside the StackLayout with more than one children, the SfListView will not be loaded. Because, the StackLayout passes the height for the SfListView as 1.

When loading the SfListView inside the Grid with row definition as Auto in UWP, Grid passes the height for the SfListView to be 1.

<local:ExtScrollView x:Name="scrollView" >
   <sync:SfListView x:Name="listView" ItemsSource="{Binding BookInfo}"/>
</local:ExtScrollView>

When the SfListView is loaded inside the ScrollView with sticky header and sticky group header, it changed to scrollable. The empty space remains after the SfListView items, when the device orientation is changed to horizontal. Because, the total extend is set to the ScrollView in horizontal orientation

public class ExtScrollView: ScrollView
{    
     protected override void LayoutChildren(double x, double y, double width, double height)
     {
         this.Content.HeightRequest = height;
         base.LayoutChildren(x, y, width, height);
     }
}

To know more about MVVM in ListView, please refer our documentation here

xamarin.forms-listview-inside-scrollview's People

Contributors

gnanapriyan avatar gnanapriyanamasivayam avatar jayaleshwari avatar lakshminatarajan avatar sarubala20 avatar syncfusionbuild avatar syncsiva avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.