android listview滚动条,在 Android 上 ListView 快速滚动

在 Android 上 ListView 快速滚动ListView Fast Scrolling on Android

07/10/2018

本文内容

此 Android 平台特定用于启用快速滚动查看中的数据 ListView 。This Android platform-specific is used to enable fast scrolling through data in a ListView. 它通过将 ListView.IsFastScrollEnabled 附加属性设置为值在 XAML 中使用 boolean :It's consumed in XAML by setting the ListView.IsFastScrollEnabled attached property to a boolean value:

xmlns:android="clr-namespace::::no-loc(Xamarin.Forms):::.PlatformConfiguration.AndroidSpecific;assembly=:::no-loc(Xamarin.Forms):::.Core">

...

GroupDisplayBinding="{Binding Key}"

IsGroupingEnabled="true"

android:ListView.IsFastScrollEnabled="true">

...

此外,还可以使用 Fluent API 从 c # 使用该方法:Alternatively, it can be consumed from C# using the fluent API:

using :::no-loc(Xamarin.Forms):::.PlatformConfiguration;

using :::no-loc(Xamarin.Forms):::.PlatformConfiguration.AndroidSpecific;

...

var listView = new :::no-loc(Xamarin.Forms):::.ListView { IsGroupingEnabled = true, ... };

listView.SetBinding(ItemsView.ItemsSourceProperty, "GroupedEmployees");

listView.GroupDisplayBinding = new Binding("Key");

listView.On().SetIsFastScrollEnabled(true);

ListView.On方法指定此平台特定的仅在 Android 上运行。The ListView.On method specifies that this platform-specific will only run on Android. The ListView.SetIsFastScrollEnabled method, in the :::no-loc(Xamarin.Forms):::.PlatformConfiguration.AndroidSpecific namespace, is used to enable fast scrolling through data in a ListView. 此外, SetIsFastScrollEnabled 通过调用方法返回快速滚动是否启用,方法可用于切换快速滚动 IsFastScrollEnabled :In addition, the SetIsFastScrollEnabled method can be used to toggle fast scrolling by calling the IsFastScrollEnabled method to return whether fast scrolling is enabled:

listView.On().SetIsFastScrollEnabled(!listView.On().IsFastScrollEnabled());

结果是,可以在中快速滚动浏览数据 ListView ,这将更改滚动块的大小:The result is that fast scrolling through data in a ListView can be enabled, which changes the size of the scroll thumb:

4f255f936346e4297cb5eb09fb561ff5.png4f255f936346e4297cb5eb09fb561ff5.png

相关链接Related links

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值