本例要达到的效果是,
(1)点击ListView的item时会有指定的背景,
(2)松手之后,刚才点击的item也会有指定的背景
实现(1)很简单:在xml中为ListView设置listSelector即可。
<ListView
android:id="@+id/pop_listview_left"
android:layout_width="ma...
分类:
其他好文 时间:
2014-09-26 20:55:18
阅读次数:
153
问题:
ScrollView与ListView共存时,ListView会只显示一行,其它行无法显示。
解决方案:
重写ListView如下即可解决问题。
/**解决ScorllView与ListView共存时,ListView只显示一行、不能完全显示的问题。
* @author Caiyuan Huang
* 2014-9-26
*/
public class...
分类:
其他好文 时间:
2014-09-26 20:23:28
阅读次数:
121
本文採用一个Demo来展示Android中ExpandableListView控件的使用,如怎样在组/子ListView中绑定数据源。直接上代码例如以下:程序结构图:layout文件夹下的 main.xml 文件源代码例如以下: 包 com.andyidea.demo中C...
分类:
移动开发 时间:
2014-09-26 20:12:38
阅读次数:
216
1. ListView分页加载实现思路实现OnScrollListener 接口重写onScrollStateChanged 和onScroll方法,使用onscroll方法实现”滑动“后处理检查是否还有新的记录,如果有,调用 addFooterView,添加记录到adapter, adapter调...
分类:
其他好文 时间:
2014-09-26 13:50:48
阅读次数:
319
package com.rebound.myscroll;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Animat...
分类:
其他好文 时间:
2014-09-26 12:38:48
阅读次数:
177
主要实现的功能: 数据少的时候则布局显示的效果为:下面的button紧随listView下面; 数据多的时候:button则固定在整个界面的底部。 布局文件如下:
分类:
其他好文 时间:
2014-09-26 11:28:48
阅读次数:
150
通过重写ScrollView和Listview完成上下滑动选中不同位置标题的内容效果;ListView嵌套在ScrollView中不能完全显示的冲突...
分类:
其他好文 时间:
2014-09-25 19:31:57
阅读次数:
220
public abstract class SimpleBaseAdapter extends BaseAdapter {
protected Context context;
protected List data;
public SimpleBaseAdapter(Context context){
this(context, null);
}
public SimpleBa...
分类:
移动开发 时间:
2014-09-25 15:54:29
阅读次数:
365
Android ListView显示不了内容? Adapter刷新无效 ?
分类:
移动开发 时间:
2014-09-25 15:46:49
阅读次数:
247
Android中的ListView应该算是布局中几种最常用的组件之一了,使用也十分方便,下面将介绍ListView几种比较常见的优化方法:...
分类:
移动开发 时间:
2014-09-25 12:24:18
阅读次数:
221