所以我正在使用 Android 4.0 Library 开发一个 Android 应用程序。
此应用程序的一项活动由具有图像背景和切换按钮的 RelativeLayout 组成。当用户切换按钮时,布局的背景图像必须改变。
所以它必须从activity.java类内部改变:
if (toggleButton.isChecked()){
// Change the background of the activity to image 2 (for example)
}
else{ // when toggle button is off
// Change it back to image 1
}
请帮我解决一下这个。谢谢 :)