语言

ISectionIndexer.GetSectionForPosition(Int32) 方法

定义

给定适配器内的位置,返回节对象数组中相应节的索引。

[Android.Runtime.Register("getSectionForPosition", "(I)I", "GetGetSectionForPosition_IHandler:Android.Widget.ISectionIndexerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int GetSectionForPosition(int position);
[<Android.Runtime.Register("getSectionForPosition", "(I)I", "GetGetSectionForPosition_IHandler:Android.Widget.ISectionIndexerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetSectionForPosition : int -> int

参数

position
Int32

要为其返回相应节索引的适配器中的位置

返回

节对象数组中相应节的索引,限制为位于数组边界内

属性

注解

给定适配器内的位置,返回节对象数组中相应节的索引。

如果节索引位于节数组边界之外,则必须将索引剪裁为位于节数组的大小内。

例如,请考虑索引器,其中数组索引 0 处的节从适配器位置 100 开始。 调用位置为 10 的方法(在第一节之前)必须返回索引 0。

适用于 . 的 android.widget.SectionIndexer.getSectionForPosition(int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于