首页 > 其他 > 详细

Textview的左边图片设置

时间:2014-09-29 19:11:43      阅读:471      评论:0      收藏:0      [点我收藏+]

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开发” 博客,谢绝转载!

Textview的左边图片设置

原文:http://9238253.blog.51cto.com/9228253/1559464

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!