Here are the components in my activity:
Code
if ( condition ) {
bottombar.getLayoutParams().height = RelativeLayout.LayoutParams.WRAP_CONTENT;
} else {
bottombar.getLayoutParams().height = 0;
}
this.findViewById(android.R.id.content).invalidate();
It seems the invalidate() doesn't work at all. If I add something, I set the height of the bottom bar. The view is not refreshed at all. It will be only refreshed after I scroll my ListView.
Any idea? Thanks
Instead of invalidate()
, you should call requestLayout()
after changing the height of the relative layout.