zoukankan      html  css  js  c++  java
  • listview 常用智识总结

    listview 使用小技艺,如果不知道可能要花比较比的时间去解决

    去除ListView滑到顶部和底部时边缘的黑色阴影:

    Xml代码 
    1. android:fadingEdge="none"  

    去除拖动时默认的黑色背景:

    Xml代码 
    1. android:cacheColorHint="#00000000"  

    去除选中时的黄色底色:

    Xml代码 
    1. android:listSelector="#00000000"  

    去除行与行之间的黑线:

    Java代码 收藏代码
    1. msgList.setDivider(null);  

    自定义选中效果

    android:listSelector="@drawable/选择器文件"

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    
        <item android:drawable="@color/white" android:state_window_focused="false"/>
        <!-- 没有焦点时的背景图片 -->  
      <item android:state_window_focused="false"   
            android:drawable="@drawable/list_item_sel" />   
        <!-- 选中时的图片背景 -->
        <item android:drawable="@drawable/list_item_sel" android:state_selected="true" />
        <item android:drawable="@drawable/list_item_sel" android:state_focused="true"/>
    
    </selector>

    互联网 信息聚合网站 : www.yidin.net 聚合互联网最优质资源、协助设计、分享经验、提升自我 欢迎访问(投稿,招聘信息请入)

    欢迎各位同学加入 android 技术二群 222392467 

     

  • 相关阅读:
    write to logfile
    open and read a file content to a variable
    strategy
    Android 开机启动程序
    消息队列
    卡机音乐功能实现
    Android 2.0 开机动画文件分析
    多线程实例
    消息队列
    多线程实例
  • 原文地址:https://www.cnblogs.com/ondream/p/2640006.html
Copyright © 2011-2022 走看看