I have a hidden image button in one of my xmls layouts, with the background set to the drawn image. I set the visibility to invisible, as I want the image to be displayed once in a while. The problem is that even if the one being drawn is not displayed, the image button still takes up space - is there a way to hide the background image and make it size 0 until I call it in my main class?
Thanks!
Edit: So, in my xml, how would I write this?
<ImageButton android:id="@+id/myimage" android:visibility="invisible" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/my_image"></ImageButton>
I want the image to always go away, if a certain condition does not arise, I want the image to be visible under this one condition. So in my xml I will need to install GONE, but in my conditional statement I will say something like:
myimage.setVisibility (SHOW) ;?
source share