更改背景Andrid [英] Change Background Andrid

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

问题描述

你好!我的第一个Android应用程序有问题.按下按钮时,我需要更改背景.例如,我有3张图片和3个按钮,当我按1按钮时,我会在背景上看到第一张图片,当我按第二按钮时,我会在背景上看到第二张图片.我找到了解决方法,该方法如何更改颜色而不更改图片.请帮助.

Hello! I have a problem with my first Android app. I need to change background when press a button. For example I have 3 pictures and 3 buttons,when I press 1 button I will see 1st picture at the backgrond, when I press 2-nd button I will see 2-nd picture at the backround. I found solution how to change colour but not pictures.Please help.

推荐答案

尝试在Button单击上使用

Try to use on Button Click

yourBaseLayout.setBackgroundColor(color)



这已经解决了我的问题.

检查此博客



This has been solved my problem.

Check this Blog


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

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