点击时更改背景图像 - Android
我正在尝试编写一个基本应用程序,当在任何地方点击手机时,背景图像都会发生变化。 如果有人可以将我链接到有关如何执行此操作的良好教程或有一些我可以使用的代码片段,我将不胜感激。
是否可以在 xml 中对其进行编码,或者是否需要在 java 中完成?
I am trying to write a basic app that when the phone is tapped anywhere, the background image changes.
If anyone could link me to a good tutorial on how to do this or have some code snippits i could use it would be greatly appreciated.
Also is this possilble to code this in the xml or does it need to be done in java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 onClick 事件添加到布局并在侦听器中更改背景。
在 xml
和您的活动中
Add an onClick event to the layout and in the listener, change the background.
in xml
and in your activity