如下图,是目前可以实现的效果,但是我想要把 "今天"以前的部分(##的部分)去掉,也就是不显示,请问该怎么实现呢??需要修改的部分在我的内部类中:::代码如下::
private class DayAdapter extends AbstractWheelTextAdapter { // 向下的天数
private final int daysCount = 20;
private Calendar calendar; /**
 * Constructor
 */
protected DayAdapter(Context context, Calendar calendar) {
super(context, R.layout.time2_day, NO_RESOURCE);
this.calendar = calendar; setItemTextResource(R.id.time2_monthday);
} @Override
public View getItem(int index, View cachedView, ViewGroup parent) {
// int day = -daysCount / 2 + index;
int day = -daysCount / 2 + index;
int sum = day + index;
Log.v("getItem", "day = " + day + "; index = " + index
+ "; day + index = " + (day + index));
Calendar newCalendar = (Calendar) calendar.clone(); newCalendar.roll(Calendar.DAY_OF_YEAR, day); View view = super.getItem(index, cachedView, parent); if (day == 0) { TextView weekday = (TextView) view
.findViewById(R.id.time2_weekday);
weekday.setText(""); TextView monthday = (TextView) view
.findViewById(R.id.time2_monthday);
monthday.setText("今天");
monthday.setTextColor(0xFF0000F0);
} else {
if (day > 0) {
TextView weekday = (TextView) view
.findViewById(R.id.time2_weekday);
DateFormat format_week = new SimpleDateFormat("EEE");
weekday.setText(format_week.format(newCalendar.getTime())); TextView monthday = (TextView) view
.findViewById(R.id.time2_monthday);
DateFormat format_month = new SimpleDateFormat("MMM d");
monthday.setText(format_month.format(newCalendar.getTime()));
monthday.setTextColor(0xFF111111);
} else {

TextView weekday_move = (TextView) view
.findViewById(R.id.time2_weekday);
 weekday_move.setText("##");
} }
return view;
} @Override
public int getItemsCount() {
return daysCount + 1;
} @Override
protected CharSequence getItemText(int index) {
return "";
}
}
上面代码是自定义的Adapter的代码,需要引用的Layout布局如下图: