摘要: android中常常需要我们自定义Adapter,甚至经常建一个包专门放各种自定义adapter类。常见的有ListView继承自BaseAdapter的adapter、ExpandableListView继承自BaseExpandableListAdapter的adapter等。-->第一种方式:每一次都重新定义一个View载入布局,再加载数据public View getView(int position, View convertView, ViewGroup parent) { View item = mInflater.inflate(R.layout.list_item_ic 阅读全文
posted @ 2013-09-23 19:50 小子千金 阅读(449) 评论(0) 推荐(0) 编辑
摘要: 首先,有View。inflate()和Layoutinflater。inflate()两个方法,但看一下源码就知道其实是一种: public static View inflate(Context context, int resource, ViewGroup root) { LayoutInflater factory = LayoutInflater.from(context); return factory.inflate(resource, root); }再者,获取LayoutInflater对象的方法,不止上面写的LayoutInflater.f... 阅读全文
posted @ 2013-09-13 12:33 小子千金 阅读(416) 评论(0) 推荐(0) 编辑