动态改变背景的LinearLayout [英] Dynamically change the background LinearLayout

查看:180
本文介绍了动态改变背景的LinearLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何动态地改变背景的LinearLayout?

How to dynamically change the background LinearLayout?

推荐答案

您是否尝试过的其中之一:

Did you try one of these :

yourLayout.setBackgroundColor(int color);
yourLayout.setBackgroundDrawable(Drawable d);
yourLayout.setBackgroundResource(int resid);

如果没有自己刷新,这应该给它一个升压:

and if does not refresh on its own, this should give it a boost :

   yourLayout.invalidate();

这篇关于动态改变背景的LinearLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆