I\'ve a RelativeLayout thus:
RelativeLayout
// <-- View.VISIBLE OR View.GONE <
Forget about INVISIBLE or GONE, use this instead:
INVISIBLE
GONE
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) view.getLayoutParams(); params.height = 0; params.setMargins(0,0,0,0); view.setLayoutParams(params);