这只发生在 SonyTV 盒子上。这是一个屏幕截图:
前 2 个项目有角问题。我删除了可能导致此问题的代码,根据条件将图像设置为可见或不可见。
@Override
public View getView(int position, View convertView, ViewGroup parent) {
int right = 0, top = 0, bottom = 0;
View view = convertView;
ViewHolder holder;
if (view == null) {
view = mInflater.inflate(R.layout.forecast_item, null);
LayoutParams lp = (LayoutParams)view.getLayoutParams();
lp = new LayoutParams(LayoutParams.MATCH_PARENT, mHeight);
holder = new ViewHolder();
holder.dateText = (TextView)view.findViewById(R.id.forecastDateText);
holder.dayText = (TextView)view.findViewById(R.id.forecastDayText);
holder.img = (ImageView)view.findViewById(R.id.forecastItemIcon);
holder.realfeelText = (TextView)view.findViewById(R.id.forecastReelFeelText);
holder.temperatureText = (TextView)view.findViewById(R.id.forecastHiLoTemp);
// holder.alarmIcon = (ImageView)view.findViewById(R.id.alarm_img);
holder.hiLoLabel = (TextView)view.findViewById(R.id.forecastHiLoLabel);
view.setTag(holder);
view.setLayoutParams(lp);
} else {
holder = (ViewHolder)view.getTag();
}
ForecastModel f = mForecastList.get(position);
holder.dayText.setText(f.name);
Utilities.resizeText(mBaseSize, mResizeFactor, 8, holder.dayText);
holder.dateText.setText(Utilities.doDateConversion(f.date, mWd));
String iconBuf = (f.iconCode.length() == 1) ? "0" + f.iconCode : f.iconCode;
holder.img.setImageResource(Utilities.getDrawableId("icon_" + iconBuf));
holder.temperatureText.setText(f.high + DEG + "/" + f.low + DEG);
holder.realfeelText.setText(f.reelfeelhigh + DEG + "/" + f.reelfeellow + DEG);
holder.hiLoLabel.setVisibility(mContext.getResources().getConfiguration().locale.getLanguage().contains(ENGLISH)
? View.VISIBLE : View.INVISIBLE);
// if (position < 3 && Alarms.hasAlarm(mWd.getCurrentWeatherDataModel(), f)){
// holder.alarmIcon.setVisibility(View.VISIBLE);
// } else holder.alarmIcon.setVisibility(View.GONE);
...
return view;
}
任何想法为什么会发生这种情况?这在电视设置为 720p 而不是 1080p 时有效。“每小时”选项卡也是一个 listAdapter,但它可以工作。