GridView实现图文信息BaseAdapter

导读:publicStringgetTitle(){returntitle;}publicvoidsetTitle(Stringtitle){this.title=title;}publicintgetImageId(){returnimageId;}publicvoidsetImageId(intimageId){this.imageId=imageId;}}}

GridView实现图文信息BaseAdapter

public String getTitle() {

return title; }

public void setTitle(String title) {

this.title = title; }

public int getImageId() {

return imageId; }

public void setImageId(int imageId) {

this.imageId = imageId; } }

}

package com.wyj.gridviewdemo;

import android.app.Activity; import android.os.Bundle; import android.widget.GridView;

public class GridViewDemo extends Activity {

private GridView gridView;

private String[] title = new String[] { \

private int[] images = new int[]

{ R.drawable.p1, R.drawable.p2, R.drawable.p3, R.drawable.p4, R.drawable.p5, R.drawable.p6, R.drawable.p7, R.drawable.p8, R.drawable.p9, };

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState); setContentView(R.layout.main);

gridView = (GridView) findViewById(R.id.gridview);

gridviewAdapter adapter = new gridviewAdapter(title, images, this);

gridView.setAdapter(adapter); } }

五星文库wxphp.com包含总结汇报、IT计算机、人文社科、资格考试、经管营销、word文档、外语学习、行业论文、专业文献以及GridView实现图文信息BaseAdapter等内容。

本文共2页12