【问题标题】:Why is the fast scroll bar not showing in Lollipop为什么 Lollipop 中不显示快速滚动条
【发布时间】:2016-04-19 09:11:37
【问题描述】:

所以我有一个ListView,我正在尝试向它添加快速滚动条,如下所示:

<ListView
    android:id="@+id/my_list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fastScrollAlwaysVisible="true"
    android:fastScrollEnabled="true" />

这在 API 19 上运行良好,但在 API 21 或 22 上它根本不显示 - 在模拟器和设备上。

谁能告诉我为什么?

【问题讨论】:

  • 奇怪,对我来说效果很好
  • 和我一样。也许是一些样式问题?
  • 创建了一个示例项目来测试它,它工作正常......所以肯定有其他影响它的东西 - 不过感谢帮助!

标签: android listview android-5.0-lollipop fastscroll


【解决方案1】:

您的适配器是否实现了SectionIndexer

package android.widget;

public interface SectionIndexer {
    Object[] getSections();

    int getPositionForSection(int var1);

    int getSectionForPosition(int var1);
}

【讨论】:

    猜你喜欢
    • 2015-05-17
    • 2012-02-20
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 2011-04-27
    • 1970-01-01
    • 2023-02-25
    • 2023-04-02
    相关资源
    最近更新 更多