Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syncfusionexamples/xamarin.forms-listview-inside-scrollview
Sample showcases how to load Xamarin.Forms Listview inside Scrollview.
https://github.com/syncfusionexamples/xamarin.forms-listview-inside-scrollview
listview scrollview sflistview xamarin xamarin-android xamarin-forms xamarin-ios xamarin-listview xamarin-uwp
Last synced: 7 days ago
JSON representation
Sample showcases how to load Xamarin.Forms Listview inside Scrollview.
- Host: GitHub
- URL: https://github.com/syncfusionexamples/xamarin.forms-listview-inside-scrollview
- Owner: SyncfusionExamples
- Created: 2019-08-02T05:45:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-15T13:47:14.000Z (10 months ago)
- Last Synced: 2024-04-14T12:07:22.693Z (8 months ago)
- Topics: listview, scrollview, sflistview, xamarin, xamarin-android, xamarin-forms, xamarin-ios, xamarin-listview, xamarin-uwp
- Language: C#
- Homepage:
- Size: 502 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfListView.XForms~Syncfusion.ListView.XForms.SfListView~AllowSwiping.html) 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.
```
```
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](https://help.syncfusion.com/xamarin/sflistview/mvvm)