更改背景图片 [英] change the background image

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

问题描述

如果有玩家赢得游戏,如何在每个阶段更改游戏应用程序中的背景图像?请帮助我..

How do I change the background image in my game application in every stage if any players win the game? Please help me..

推荐答案

您可以实例化新的AbsoluteLayout对象.

You can instantiate new AbsoluteLayout object.

AbsoluteLayout al = (AbsoluteLayout) findViewById(R.id.widget0); 
al.setBackgroundDrawable(yourDrawableID);


顺便说一句,你也可以做


By the way, you can also do

al.setBackgroundResource(resourceID); 


如果要删除背景,则带有resourceID的应导航到可绘制的ID并设置为0.


with resourceID should navigate to a drawable ID and set to 0 if you want to remove the background.


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

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