解决方案 »

  1.   

    点击之后将position记录下来
    在adapter的getview中判断position如果点击过则一种颜色,否则就另一种颜色。
      

  2.   

    那就别用listview,动态生成layout
      

  3.   

    那就别用listview,动态生成layout解决了,采用了你说的建议:@SuppressWarnings("unchecked")
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {            if (convertView == null) {
                    convertView = inflater.inflate(R.layout.news_cell, null);
                }            HashMap<String, Object> map = (HashMap<String, Object>) getItem(position);
                Boolean read = (Boolean) map.get("read");
                TextView title = (TextView) convertView.findViewById(R.id.menuTextView);
                if (read) {
                    title.setTextColor(getResources().getColor(R.color.sub_title_color));
                } else {
                    title.setTextColor(getResources().getColor(R.color.title_color));
                }
                return super.getView(position, convertView, parent);
            }