zoukankan      html  css  js  c++  java
  • ListView

    1:ListView 

    A:主要属性

    android:stackFromBottom="true"   值为true和false, ListView 列表从最下面开始显示
    android:transcriptMode="alwaysScroll"    自动滑动到最底部
    android:cacheColorHint="#00000000"
            cacheColorHint属性,很多人希望能够改变一下它的背景,使他能够符合整体的UI设计,改变背景背很简单只需要准备一张图片然后指定属性 android:background="@drawable/bg",不过不要高兴地太早,当你这么做以后,发现背景是变了,但是当你拖动,或者点击list空白位置的时候发现ListItem都变成黑色的了,破坏了整体效果。
    如果你只是换背景的颜色的话,可以直接指定android:cacheColorHint为你所要的颜色,如果你是用图片做背景的话,那也只要将android:cacheColorHint指定为透明(#00000000)就可以了
    android:divider 属性,该属性作用是每一项之间需要设置一个图片做为间隔,或是去掉item之间的分割线
    android:divider="@drawable/list_driver"  其中  @drawable/list_driver 是一个图片资源,如果不想显示分割线则只要设置为android:divider="@drawable/@null" 就可以了
    fadingEdge属性,上边和下边有黑色的阴影   android:fadingEdge="none" 设置后没有阴影了
    android:scrollbars 属性,作用是隐藏listView的滚动条,
    android:scrollbars="none"与setVerticalScrollBarEnabled(true);的效果是一样的,不活动的时候隐藏,活动的时候也隐藏

    fadeScrollbars属性,android:fadeScrollbars="true"  配置ListView布局的时候,设置这个属性为true就可以实现滚动条的自动隐藏和显示。

    android:choiceMode 规定此ListView所使用的选择模式。缺省状态下,list没有选择模式。属性值必须设置为下列常量之一: none,值为0,表示无选择模式;singleChoice,值为1,表示最多可以有一项被选中;multipleChoice,值为2,表示可以多项被选中。可参看全局属性资源符号choiceMode。

    B:ListView 滑块设置   
    设置快速滚动属性很容易,只需在布局的xml文件里设置属性即可:
    <ListView android:id=”@+id/listView” android:layout_width=”fill_parent”
    android:layout_height=”fill_parent” android:fastScrollEnabled=”true”
    android:focusable=”true” />
    但是有时候会发现设置属性无效,滚动ListView并未出现滑块。原因是该属性生效有最小记录限制。当ListView记录能够在4屏以内显示(也就是说滚动4页)就不会出现滑块。

    自定义可参考:http://407827531.iteye.com/blog/1064633 

    2:GridView

    http://tigerszdf.blog.163.com/blog/static/459551332010320112026975/

    http://www.cnblogs.com/over140/archive/2010/10/19/1855366.html

    http://blog.csdn.net/flowingflying/article/details/6265206

    3:

查看全文
  • 相关阅读:
    windows防火墙失效
    unity_animator_stop_replay(重新播放)
    使用rider做为unity的代码编辑器
    分母为0的坑(float)
    动画或特效不会播放(被裁剪)
    UGUI在两个UI间坐标转换
    informix 查看 当前锁表
    java protected 与默认权限的区别
    Java 定时任务
    在线支付
  • 原文地址:https://www.cnblogs.com/zsw-1993/p/4879947.html
  • Copyright © 2011-2022 走看看