我有一个幻灯片益智游戏。
我想按位置(ID)更改 GridView
上的图片。
我怎么能这样做?
答案 0 :(得分:3)
试试这个
gridView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3)
{
// You can get position of item or imageView and again you can set new image
// by setBackGround() by getting this position
}
});