Android中使用listview出现数据紊乱 androidlistview 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 点击之后将position记录下来在adapter的getview中判断position如果点击过则一种颜色,否则就另一种颜色。 那就别用listview,动态生成layout 那就别用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); } android 4.0 开发人员选项实现原理和源码 android线程里运行1个方法。 请问Android上大文件传输到服务器(Web), 最大能传输多大的文件 如何让开机后第一个运行的程序是我的程序,而不是Launcher? 关于intent-filter android flash播放器 【求助】listview的每行放多个textview怎么填充数据 SOAP解析天气服务,查询无结果问题 android高手 求解答几个问题 多谢 android 分析网站源代码 Fragment保存状态 Android Studio,无法创建新工程
在adapter的getview中判断position如果点击过则一种颜色,否则就另一种颜色。
@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);
}