setBackgroundDrawable和setBackgroundColor的用法(转)

转自“http://blog.sina.com.cn/s/blog_9dd7675101012v1h.html”

setBackgroundDrawable和setBackgroundColor的用法

1.设置背景图片,图片来源于drawable;

flightInfoPanel.setBackgroundDrawable(getResources().getDrawable(R.drawable.search_label_click));

2.转换字符串为int(颜色);

listItemView.deleteFilghtBg.setBackgroundColor(Color.parseColor("#F5F5DC"));

posted on 2016-01-09 15:22  trako  阅读(215)  评论(0编辑  收藏  举报

导航