如何自定义阿尔法 - 索引虽然FastScrolling阿尔法、自定义、索引、FastScrolling

2023-09-07 14:36:58 作者:余生一个她

我使用的是的ListView AlphaIndexer 实施 SectionIndexer 。我想知道,如果有反正自定义显示的APLHA-索引中,而快速滚动即改变其颜色,背景,文字的字体/颜色等,像:

I have a ListView with AlphaIndexer implementation using SectionIndexer. I was wondering that if there is anyway to customize the Aplha-Indexer box shown while fast scrolling i.e. changing its color, background, text font/color etc. Like :

编辑 或者,当这个箱子毗邻 FastScroll拇指。这样的:

Edited OR, When this box is adjacent to FastScroll Thumb. like:

推荐答案

如果您使用的是主题参照您的应用程序内的 RES / VAL /风格和它的变种风格-V11 风格-V14 。然后,你一定能实现自定义 fastscroll索引

If you are using Theme inside your application with reference to res/val/style and it's variant styles-v11 or styles-v14.Then you can surely achieve customize fastscroll indexer.

风格-V11附加这些属性风格-V14 你的父母在主题属性。

<style name="Theme.Zname" parent="@style/Theme.Sherlock.Light">
<item name="android:fastScrollPreviewBackgroundLeft">@drawable/_ics_fastscroll_label_left</item> 
<item name="android:fastScrollPreviewBackgroundRight">@drawable/_ics_fastscroll_label_right</item>
</style>

下面,因为它是使用 ActionBarSherlock ,所以风格 fastScroll previewBackgroundLeft fastScroll previewBackgroundRight 附加在它与作品API&GT; 11

Here as it is using ActionBarSherlock, so styles fastScrollPreviewBackgroundLeft and fastScrollPreviewBackgroundRight are appended in it works with API >11.

绘制/ _ics_fastscroll_label_left