使用如下方法可以获取listview中的单个控件,并进行相应的操作使用

lv.setOnItemClickListener(new OnItemClickListener(){

                        @Override

                        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,

                                        long arg3) {

                                // TODO Auto-generated method stub

                                )(TextView)arg1.findViewById(R.id.tv)).setTextColor(Color.RED);

                        }

        });

这里的tv是listview布局文件中的TextView控件,在这里重新设置了其文字的颜色。

相关文章:

  • 2021-11-19
  • 2021-12-25
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
猜你喜欢
  • 2021-07-16
  • 2021-07-22
  • 2022-12-23
  • 2022-02-16
  • 2021-12-20
  • 2021-11-19
相关资源
相似解决方案