Question

I got a menu with images over each other as the background image. I also have buttons which will take me to the next menu and eventually the game itself.

What i would like to know is how to change one of those images i have as the background image of the layout with a button ? The buttons themselves are transparent.

Is there any way this could be done? or do I have to use the buttons to hold images which will change upon pressed. For an example I want the play button to get bigger when i press it, before I release (got the images already) it.

No correct solution

OTHER TIPS

You can use a buttonSelector.xml which will change the background on the basis of events on that button

e.g. of selector xml is given below. You need to put it into drawables folder...

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/add_folder_clicked" /> <!-- pressed --> <item android:state_focused="true"
android:drawable="@drawable/add_folder_hover" /> <!-- focused --> <item android:drawable="@drawable/add_folder" /> <!-- default --> </selector>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top