如何设置gridview中的某个item不可选中
1个回答
2014-12-25
展开全部
给GridView添加item选中备茄橡监听
gridview.setOnItemClickListener(new MyOnItemClickListener());
监听类里重载onItemClick方法,
class MyOnItemClickListener implements AdapterView.OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
arg0.getItemAtPosition(arg2) 这个就是你所选中仿旁的item,想纳衡干嘛干嘛
}
gridview.setOnItemClickListener(new MyOnItemClickListener());
监听类里重载onItemClick方法,
class MyOnItemClickListener implements AdapterView.OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
arg0.getItemAtPosition(arg2) 这个就是你所选中仿旁的item,想纳衡干嘛干嘛
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询