Android: How to hide a view and collapse the view's allocated space

When you call View.setVisibility(View.INVISIBLE), you'll notice that view is still taking up space on the screen but not being drawn.

To prevent the view from leaving a big empty gap, simply use View.GONE instead of View.INVISIBLE.

To bring it back, just use View.VISIBLE.

[ Source ]

Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog