ListView BaseAdapter:
package com.example.android_listview_activity; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; /** * @desc 自定义适配器 * @author ljt * @time 2014年8月27日 上午11:15:27 */ public class MainActivity5 extends Activity{ private static final String TAG = "MainActivity"; private ListView listView; private int[] images = {R.drawable.abc_ic_go_search_api_holo_light,R.drawable.abc_ic_go_search_api_holo_light}; private String[] names = {"北京","上海"}; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listView = (ListView)this.findViewById(R.id.listView1); MyAdapter adapter = new MyAdapter(); listView.setAdapter(adapter); } /** * @desc 自定义适配器 * @author ljt * @time 2014年8月27日 上午11:09:13 */ class MyAdapter extends BaseAdapter{ /** * How many items are in the data set represented by this Adapter. */ @Override public int getCount() { return names.length; } /** * Get the data item associated with the specified position in the data set. */ @Override public Object getItem(int position) { return names[position]; } /** * Get the row id associated with the specified position in the list. */ @Override public long getItemId(int position) { return position; } /** * 创建列表项 */ @Override public View getView(int position, View convertView, ViewGroup parent) { Log.i(TAG, "position == "+position); // 将layout的xml布局文件实例化为View类对象 View view = getLayoutInflater().inflate(R.layout.source2,null); ImageView imageView = (ImageView)view.findViewById(R.id.imageView3); imageView.setImageResource(images[position]); TextView textView = (TextView)view.findViewById(R.id.textView3); textView.setText(names[position]); return view; } } }
相关推荐
PADS Layout四层板设置简明教程.pdf
DevExpress VCL v2012 vol 1.6 Delphi VCL. 包含所有源码、例子、帮助 支持Metro啦! What's New in DevExpress VCL 12.1.6 Release Notes The following sections list all minor and major changes in ...
DevExpress VCL v2012 vol 1.6 Delphi VCL. 包含所有源码、例子、帮助 支持Metro啦! What's New in DevExpress VCL 12.1.6 Release Notes The following sections list all minor and major changes in ...
DevExpress VCL v2012 vol 1.6 Delphi VCL. 包含所有源码、例子、帮助 支持Metro啦! What's New in DevExpress VCL 12.1.6 Release Notes The following sections list all minor and major changes in ...
DevExpress VCL v2012 vol 1.6 Delphi VCL. 包含所有源码、例子、帮助 支持Metro啦! What's New in DevExpress VCL 12.1.6 Release Notes The following sections list all minor and major changes in ...
DevExpress VCL v2012 vol 1.6 包含所有源码、例子、帮助 如果你安装过其它版本的DevExpressVCL,安装前请完全卸载老版本的Dev控件,并执行“清理Dev残余文件”,清理System32下的DevExpress的BPL文件。 What's...
DevExpress VCL v2012 vol 1.6 包含所有源码、例子、帮助 如果你安装过其它版本的DevExpressVCL,安装前请完全卸载老版本的Dev控件,并执行“清理Dev残余文件”,清理System32下的DevExpress的BPL文件。 What's...
DevExpress VCL v2012 vol 1.6 Delphi VCL. 包含所有源码、例子、帮助 支持Metro啦! What's New in DevExpress VCL 12.1.6 Release Notes The following sections list all minor and major changes in ...
ComponentSet是一个Java swing 控件集,包括JWizardPane, JListView, Layout Suite(CellLayout, BoxLayout2, CardLayout2, GridLayout2), JDirChooser, JCalendar, JFontChooser, JLinkButton, JSidePane, JSideBar, ...
CS Hud Observer 是 CS 1.6 的流叠加,此流叠加背后的基本思想是向流观察者显示当前不存在的游戏状态。 主意 使用通过套接字 (TCP/UDP) 的游戏服务器流事件到将运行此软件的本地流媒体,该软件将向流观察者显示数据...
软件介绍: jQuery EasyUI 官方API文档中文版V1.3.6,压缩包内附EXE/CHM...内容包括:Base(基础)Layout(布局)Menu and Button(菜单和按钮)Form(表单)Windows(窗口)DataGrid and Tree(表格和树)Extension(扩展)
Section 1.6. Data Binding Section 1.7. Dependency Properties Section 1.8. Resources Section 1.9. Styles and Control Templates Section 1.10. Graphics Section 1.11. Application Deployment ...
1.6 ASSIGN PURCHASE ORGANIZATION TO PLANT 7 1.7 CREATE PURCHASE GROUP 8 2. BASIC SETUP 10 2.1 DEFINE SCREEN LAYOUT OF MATERIAL MASTER 10 2.2 DEFINE MATERIAL TYPE 11 2.3 SETUP MATERIAL NUMBER RANGE 13 ...
Because many readers are familiar with the layout of version 1.5 and version 1.6, we have tried to change it as little as possible. Here is a summary of the main changes: • The major difference with...
根据layout.json创建layout_dev.json,其中common_config与must服务不变,其他XX_server服务里面内容都放在新的all_server服务里面 因为本地测试需要将所有服务都同时启动,rancher上面根据环境变量运行服务 例如: ...
使用Sprint Layout重新创建Amiga2000主板 如果要构建此板,请使用Amiga2000rev6.2.incl.mods.1.8.5.zip中的gerber。 唯一没有应用的是r2-c1组合的占用空间,因为它涉及移动许多迹线,而且我不知道它对电路板的工作有...
key-value store with a performance-oriented data layout that separates keys from values to minimize I/O amplification. The design of WiscKey is highly SSD optimized, leveraging both the sequential and...
Q.what is this? A.This is my example for Android IS01. Q.What kind of example... ...GPS/ Map/Layout.. RecodeSound.. Q.What is android Version. A.It's Android1.6. Because IS01 is version 1.6.
E4418CORE 基于三星和NEXELL 联合发布的四核COTEX-A9 CPU,主频最高为1.6GHz, 4418 集成了高性能GPU,具有2D 和3D 加速功能。 E4418CORE 内部集成1GB(M18 型)和2G(M2A 型)的DDR3 内存,支持DDR3-1600 内存, 总线...
E4418CORE 基于三星和NEXELL 联合发布的四核COTEX-A9 CPU,主频最高为1.6GHz, 4418 集成了高性能GPU,具有2D 和3D 加速功能。 E4418CORE 内部集成1GB(M18 型)和2G(M2A 型)的DDR3 内存,支持DDR3-1600 内存, 总线...