A ListView is a data control that can display data read from a database and use TextView to implement output.
ImageView is a control for displaying pictures that you can get to a picture in the database to display the output.
arrayadapter Text adapter: Gets the data values in the collection, array, and, in particular, loads the adapter to get the contents of the adapter to output. Ways to implement the Arrayadapter adapter:
//Create an array first
private string[] CType = new string[]{"Content 1", "Content 2", "Content 3"};
//Gets the value in the array through the text adapter
arrayadapter<string> adater =
New Arrayadapter<string> (this,android. R.id.simple_spinner_item,ctype);
//Set the option style for the adapter when the list box is pulled down
Adapter.setdropdownviewresource (Android. R.layout.simple_spinner_dropdown_item);
//Load adapter Get results
Spinner.setadapter (adapter);
Simpleadapter Graphics Adapter : Used for matching correspondence between pictures and text.
//Create an array to hold the text and an array to hold the picture first
Private string[] CType = new string[]{"Content 1", "Content 2", "Content 3"};
private int img = new Int[]{r.drawable.logo,r.drawable.logo,r.drawable.logo,};
//Graphics adapter
list<map<string,object>> datas = new arraylist<map<string,object>> ();
for (int i = 0;i<object<length;i++) {
map<string,object> map = new map<string,object> ();
Map.put ("image", img[i]);
Map.put ("name", Ctype[i]);
Datas.add (map);
}
Simpleadapter adapter = new Simpleadapter (This,datas,r.layout.list_item,
New string[]{"image", "Name"},new int[]{r.id.iv_logo,r.id.tv_name});
//Load Adapter
Lv.setadapter (adapter);
There's also a custom adapter that hasn't been worked on, and will continue tomorrow! 650) this.width=650; "src=" Http://img.baidu.com/hi/bobo/B_0054.gif "alt=" B_0054.gif "/>
This article is from the "Android Small Notes" blog, please be sure to keep this source http://dreamwing.blog.51cto.com/9872128/1609817
Android Small Notes