In Android development, when using the ListView, we often use Footerview or Headerview
The footer and headers added to the ListView are often hidden and displayed depending on the situation.
Because footer and headers use the methods of deletion and addition, they always feel bad.
When you set the view in footer and header directly to gone, the area is still occupied, although the content is not displayed.
Through various methods of testing, and finally to a perfect solution to the problem of the method, the following code:
This.footerLayout.setVisibility (View.gone); this.footerLayout.setPadding (0,-footerlayout.getheight (), 0, 0);
It means moving the content up to the height of the view.
Of course, when it needs to be displayed, it is also set back (do an if else process)
This.footerLayout.setVisibility (view.visible); this.footerLayout.setPadding (0, 0, 0, 0);
Problem solving is really, but it hurts ~ ~ ~