摘要: 个人认为BaseAdapter实在是太主要了,也是用处太广了,自己设立一个算是专题吧,主攻BaseAdapter,争取在自己的努力下,把所有的关于baseadapter的问题都给解决了。这样以后再遇到这样的问题就可以迎刃而解了。import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.os.Bundle; import android.vi 阅读全文
posted @ 2011-08-15 16:57 水向东流 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 在实际开发中LayoutInflater这个类还是非常有用的,它的作用类似于findViewById()。不同点是LayoutInflater是用来找res/layout/下的xml布局文件,并且实例化;而findViewById()是找xml布局文件下的具体widget控件(如Button、TextView等)。具体作用:1、对于一个没有被载入或者想要动态载入的界面,都需要使用LayoutInflater.inflate()来载入;2、对于一个已经载入的界面,就可以使用Activiyt.findViewById()方法来获得其中的界面元素。LayoutInflater 是一个抽象类,在文档中 阅读全文
posted @ 2011-08-15 14:39 水向东流 阅读(2932) 评论(0) 推荐(0) 编辑
摘要: 在BaseAdapter里面处理单击事件static final class MyAdapter extends BaseAdapter { /** override other methods here */ @Override public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { // inflate the view for row from xml file // keep a referenc 阅读全文
posted @ 2011-08-15 11:50 水向东流 阅读(2942) 评论(0) 推荐(0) 编辑