android 笔记: setBackgroundDrawable和setBackgroundColor的用法

来源:互联网 发布:虚拟试衣软件 编辑:程序博客网 时间:2024/05/24 04:23

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

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

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

.setBackgroundColor(Color.parseColor("#F5F5DC"));
0 0