tv_radaritem_name.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
isShow = !isShow;
if(isShow)
{
Drawable img = getResources().getDrawable(R.drawable.radar_imgpress);
img.setBounds(0, 0, img.getMinimumWidth(), img.getMinimumHeight());
tv_radaritem_name.setCompoundDrawables(null, null, img, null);
radar.setVisibility(View.VISIBLE);
liner_search.setVisibility(View.INVISIBLE);
isShow = true;
}else{
Drawable img = getResources().getDrawable(R.drawable.radar_imgnomal);
img.setBounds(0, 0, img.getMinimumWidth(), img.getMinimumHeight());
tv_radaritem_name.setCompoundDrawables(null, null, img, null);
radar.setVisibility(View.INVISIBLE);
liner_search.setVisibility(View.VISIBLE);
isShow = false;
}
}
});
本文出自 “android开发” 博客,谢绝转载!
原文地址:http://9238253.blog.51cto.com/9228253/1559464