替换layout图片背景

来源:互联网 发布:欧冠决赛数据 编辑:程序博客网 时间:2024/04/29 14:59

//找到layout

View view = LayoutInflater.from(context).inflate(R.layout.float_window_small, this);

//根据图片找到drawable

Drawable image = getResources().getDrawable(R.drawable.gift_close);
view.setBackgroundDrawable(image);
0 0
原创粉丝点击