-1

在开发Android应用程序时,我想在为这个ListView设置适配器后修改ListView中某个项目的背景,怎么做?谢谢你

4

1 回答 1

0

如果我正确理解了您的问题,那么也许您可以尝试以下示例来更改列表项的背景...您应该以 getView(int position, View convertView, ViewGroup parent) 这种方式覆盖适配器的方法:
...
convertView.setBackgroundDrawable(getContext().getResources().getDrawable(R.drawable.mybackground));
...

于 2013-01-10T15:21:38.827 回答