Hide ImageView?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Hide ImageView?

Postby scuba » Fri Nov 13, 2009 4:51 pm

Hi,

I'd like to be able to hide an ImageView in my layout at certain times. I don't just want to make it invisible, I want it to take up no space so the rest of the layout collapses appropriately. Just like in HTML where you'd set "style='display:none;'". The last thing I tried was setting the max height to 0, but that didn't work.

Is this possible to do?

Thanks! :)
scuba
Junior Developer
Junior Developer
 
Posts: 19
Joined: Wed Nov 11, 2009 4:19 am

Top

Re: Hide ImageView?

Postby FunctionalRetard » Fri Nov 13, 2009 4:57 pm

setVisibility(View.GONE) should work. http://developer.android.com/reference/ ... .html#GONE
FunctionalRetard
Junior Developer
Junior Developer
 
Posts: 10
Joined: Thu Nov 12, 2009 4:13 pm

Postby scuba » Fri Nov 13, 2009 5:12 pm

Thank you!
scuba
Junior Developer
Junior Developer
 
Posts: 19
Joined: Wed Nov 11, 2009 4:19 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 7 guests