如何在Xamarin中创建无休止的滚动
因此,我有一个应用程序,我试图创建循环滚动,例如,当向下滚动时,我得到: …-项目4-项目5-项目1-项目2-项目3-项目4-项目5-项目1-项目2-项目3- 这是一张我正在尝试的图片 因此,滚动将是无止境的,因为相同的项目将被重复。有人能帮我吗?你可以参考 以下是一个简单的示例: 安装NugetXamarin.Forms.Extended.InfiniteScrolling 页面的axml:如何在Xamarin中创建无休止的滚动,xamarin,xamarin.forms,scroll,scrollview,infinite-scroll,Xamarin,Xamarin.forms,Scroll,Scrollview,Infinite Scroll,因此,我有一个应用程序,我试图创建循环滚动,例如,当向下滚动时,我得到: …-项目4-项目5-项目1-项目2-项目3-项目4-项目5-项目1-项目2-项目3- 这是一张我正在尝试的图片 因此,滚动将是无止境的,因为相同的项目将被重复。有人能帮我吗?你可以参考 以下是一个简单的示例: 安装NugetXamarin.Forms.Extended.InfiniteScrolling 页面的axml: <?xml version="1.0" encoding="utf-8" ?> <C
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:scroll="clr-namespace:Xamarin.Forms.Extended;assembly=Xamarin.Forms.Extended.InfiniteScrolling"
x:Class="InfiniteScrollingApp.SimplePage">
<!-- a normal list view -->
<ListView CachingStrategy="RecycleElement" ItemsSource="{Binding Items}">
<!-- the behavior that will enable infinite scrolling -->
<ListView.Behaviors>
<scroll:InfiniteScrollBehavior />
</ListView.Behaviors>
<!-- the row definition -->
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding Name}" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
其影响如下:
您可以参考
以下是一个简单的示例:
安装NugetXamarin.Forms.Extended.InfiniteScrolling
页面的axml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:scroll="clr-namespace:Xamarin.Forms.Extended;assembly=Xamarin.Forms.Extended.InfiniteScrolling"
x:Class="InfiniteScrollingApp.SimplePage">
<!-- a normal list view -->
<ListView CachingStrategy="RecycleElement" ItemsSource="{Binding Items}">
<!-- the behavior that will enable infinite scrolling -->
<ListView.Behaviors>
<scroll:InfiniteScrollBehavior />
</ListView.Behaviors>
<!-- the row definition -->
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding Name}" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
其影响如下:
嗯,听起来像垂直旋转木马?我认为没有一个是天生存在的。除了在listViewHmm的数据源中放入无限多的元素之外,我想不出一种方法来实现这一点,这听起来像一个垂直旋转木马?我认为没有一个是天生存在的。除了在ListView的数据源中放入无限多的元素之外,我想不出一种方法来实现这一点。非常感谢,这正是我在寻找的行为。非常感谢,这正是我在寻找的行为
public class MyData
{
public string Name { set; get; }
}