这只发生在SonyTV盒子上。这是一个屏幕截图:
前两项有角落问题。我删除了可能导致此问题的代码,图像设置为可见或不可见,具体取决于条件。
@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,但它有效。