abe

abe
private Drawable img_time_filter,img_time_filter_selected ;
//过滤器TextView中显示的图片
img_time_filter = getResources().getDrawable(R.drawable.time_filter);
//调用setCompoundDrawables时,必须调用Drawable.setBounds()方法,否则图片不显示
img_time_filter.setBounds(0, 0, img_time_filter.getMinimumWidth(), img_time_filter.getMinimumHeight());
img_time_filter_selected = getResources().getDrawable(R.drawable.time_filter_selected);
img_time_filter_selected.setBounds(0, 0, img_time_filter_selected.getMinimumWidth(), img_time_filter_selected.getMinimumHeight());
tv_filterTime.setCompoundDrawables(img_time_filter_selected, null, null, null);
tv_filterTime.setTextColor(getResources().getColor(R.color.white));
rl_filterTime.setBackgroundColor(getResources().getColor(R.color.red));

tv_filterTime.setCompoundDrawables(img_time_filter, null, null, null);
rl_filterTime.setBackgroundColor(getResources().getColor(R.color.white)); 
lv_filterTime.setVisibility(View.INVISIBLE);

你可能感兴趣的:(abe)