WP 8.1底部向上无限滚动

4
我已经研究了ISupportIncrementalLoading,并查看了MS样例其他示例,以了解无限滚动行为。
但我想要从底部向上滚动,在向下滚动时在顶部添加项目。
编辑:我已经找到了一个解决方法。我将ListView旋转了180度,并将DataTemplate旋转了180度,这帮助我实现了所需的功能。
 <ListView x:Name="GridViewMain" IncrementalLoadingThreshold="2" RenderTransformOrigin="0.5,0.5">
        <ListView.RenderTransform>
            <RotateTransform Angle="180"></RotateTransform>
        </ListView.RenderTransform>
        <ListView.ItemContainerStyle>
            <Style TargetType="ListViewItem">
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            </Style>
        </ListView.ItemContainerStyle>
        <ListView.Resources>
            <DataTemplate x:Key="DataTemplateGridViewMain">
                <Grid HorizontalAlignment="Stretch" Background="#FF7C1A9B" RenderTransformOrigin="0.5,0.5">
                    <Grid.RenderTransform>
                        <RotateTransform Angle="180"/>
                    </Grid.RenderTransform>
                    <TextBlock HorizontalAlignment="Left" Text="{Binding}" VerticalAlignment="Center" FontSize="20" FontFamily="Tempus Sans ITC" />
                </Grid>
            </DataTemplate>
        </ListView.Resources>
        <ListView.ItemTemplate>
            <StaticResource ResourceKey="DataTemplateGridViewMain" />
        </ListView.ItemTemplate>
    </ListView>

这个解决方案是否有任何性能影响?或者有其他方法可以实现同样的效果吗?


请参考以下链接:点击这里 - Jayasri
看着它。@jayasri - Rohit Garg
它在工作吗?Rohit Garg - Jayasri
你可以尝试这个链接:http://stackoverflow.com/questions/29591835/incremental-loading-in-listview-wp8/29594470#29594470 - Kai Brummund
@KaiBrummund 我尝试了你的解决方案。但是当添加项目时,滚动查看器突然改变位置(到底部)。 - Milan Aggarwal
就像所述的那样,这不是一个完整的解决方案。要更改滚动行为,请查看https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.itemsstackpanel.itemsupdatingscrollmode.aspx - Kai Brummund
1个回答

0

不确定这是否符合您的需求,但是在创建聊天对话屏幕时,我必须做类似的事情,并且能够使用ExtendedListView实现这一点: https://www.nuget.org/packages/ExtendedListView

我们加载最近的项目,并使用ScrollIntoView(lastMessage)将光标定位到底部。通常,当滚动到底部时,您会使用MoreDataRequested事件获取项目,但是我们反转了它,并使用PullToRefreshRequested来模拟向上滚动,更改加载模板以显示“加载更多消息”。

对我们来说效果非常好,希望这对您有所帮助!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接