FastScroll(1)ListView打开FastScroll及自定义它的样式
打开 FastScroll 方式
android:fastScrollEnabled="true" 它是AbsListView的属性。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" > <ListView
android:id="@+id/list_default_fs"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fastScrollAlwaysVisible="true"
android:fastScrollEnabled="true"
> </ListView> </LinearLayout>
默认样式
自定义样式
自定义要重写主题中的下面几个属性,然后使用这个主题。
<style name="CustomFastScrollTheme" parent="AppBaseTheme">
<!-- api21 -->
<!-- <item name="android:fastScrollStyle">@style/CustomFastScrollTheme</item> --> <item name="android:fastScrollThumbDrawable">@drawable/fastscroll_thumb_aje</item>
<item name="android:fastScrollOverlayPosition">atThumb</item>
<item name="android:fastScrollTextColor">#DA4A38</item>
<!-- <item name="android:fastScrollTrackDrawable">@drawable/us</item> -->
<item name="android:fastScrollPreviewBackgroundRight">@drawable/fastscroll_preview_right</item>
</style>
效果如下
其中:
android:fastScrollThumbDrawable | 图中数字 2,手指按住时显示的图片 |
android:fastScrollOverlayPosition | 分组提示的位置 |
android:fastScrollTextColor | 分组提示的文字的颜色 |
android:fastScrollTrackDrawable | 图中数字1,FastScroll的滑动轨道 |
android:fastScrollPreviewBackgroundRight | 图中数字3,分组提示的背景图片 |
上图是一张显示分组的示例,如不分组,可只重写 android:fastScrollThumbDrawable
FastScroll(1)ListView打开FastScroll及自定义它的样式的更多相关文章
- FastScroll(2)不分组的listview 打开fastscroll的分组提示功能
本文只让fastscroll具有提示分组功能,但listview并不显示分组,如果想让分组的listview显示fastscroll,看下篇. 1,在listview中打开fastscroll 2,自 ...
- FastScroll(3)分组的listview 打开fastscroll的分组提示功能
1,让ListView显示分组(用两个layout) 2,让ListView实现sectionIndexer接口 3,代码如下: import java.util.ArrayList; import ...
- Android 自定义RadioButton的样式
Android 自定义RadioButton的样式 我们知道Android控件里的button,listview可以用xml的样式自定义成自己希望的漂亮样式. 最近用到RadioButton,利用xm ...
- ActionBar官方教程(11)自定义ActionBar的样式(含重要的样式属性表及练习示例)
Styling the Action Bar If you want to implement a visual design that represents your app's brand, th ...
- WPF界面设计技巧(4)—自定义列表项样式
原文:WPF界面设计技巧(4)-自定义列表项样式 有前面修改按钮样式的基础,我们可以尝试来定制一个即好看又好用的 ListBox ,今天先来讲“好看”部分. 打开 Microsoft Visual S ...
- [Swift通天遁地]九、拔剑吧-(3)创建多种自定义Segment分段样式的控件
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- jQuery Validate 表单验证插件----自定义校验结果样式
一.下载依赖包 网盘下载:https://yunpan.cn/cryvgGGAQ3DSW 访问密码 f224 二.引入依赖包 <script src="../../scripts/j ...
- 自定义input file样式
自定义input file样式:一般都是通过隐藏input,通过定义label来实现.这种做法要注意的是label的for属性要指定input对应的id; <!DOCTYPE html> ...
- css Cursor:url()自定义鼠标指针样式为图片
css自定义鼠标指针样式为图片Cursor:url()的使用,今天在项目中,要用到自定义鼠标样式,格式: css:{cursor:url('绝对路径的图片(格式:cur,ico)'),-moz-zoo ...
随机推荐
- 使用CSS修改HTML5 input placeholder颜色( 转载 )
问题:Chrome支持input=[type=text]占位文本属性,但下列CSS样式却不起作用: input[placeholder], [placeholder], *[placeholder] ...
- laravel扩展Debugbar
github地址:https://github.com/barryvdh/laravel-debugbar
- ubuntu安装QQ目前最完善的方法!(亲测,成功)
wine qq 2012 for linux Ubuntu 64位兼容(12月21日末日版) 由 smile » 2011-04-07 9:08 +-------------------------- ...
- 2015年1月最新中国行政区划县及以上代码mysql数据库
中华人民共和国国家统计局>> 行政区划代码>>mysql数据格式 截图如下 行政区划mysql数据库文件下载:nation.zip 转载:http://www.sdhack.c ...
- 别让emacs损伤你的小母指
刚接触emacs时感觉,这东西怎么这么难用,还说是编辑器的神,我去. 写个代码跟挫游戏机手柄似的,关键是还这么难挫,平时用的最多的左ctrl键,这么难按,可怜的我的小母指(Petyr Baelish) ...
- ENVI中利用polygon掩膜修改类到指定类
overlay——classification——制定分类的图像 edit——polygon delete from class(选择这个掩膜模式) edit——set delete class va ...
- 【Cardboard】 体验 - Google Cardboard DIY及完成后简单体验
体验 - Google Cardboard DIY及完成后简单体验 今年的Google I/O最让我感兴趣的除了Material Design以外就是这个Google Cardboard了.据说是Go ...
- Sambar,实现Linux和Windows共享
我下载的是tar的jar包,不是rpm,rpm就不多说了.目的是让Windows能够共享Linux系统的文件夹 1.进入到source文件夹: 2../configure->make->m ...
- UITableView自定义单元格
随手笔记: RootViewController代码 #import "RootViewController.h" #import "AddressContact.h&q ...
- 【BZOJ2330】 [SCOI2011]糖果
Description 幼儿园里有N个小朋友,lxhgww老师现在想要给这些小朋友们分配糖果,要求每个小朋友都要分到糖果.但是小朋友们也有嫉妒心,总是会提出一些要求,比如小明不希望小红分到的糖果比他的 ...