Headers and footer views in listview should be met. For example, loading is automatically started when scrolling to the bottom. For some application markets, viewflipper will be added in the header for application recommendation (the scrolling type seems to be available in many markets ).
Generally, you can perform the following operations when adding an object:
Listview = xxxx; listview. addhearderview (item_head); listview. setadapter (adapter );
After the page is displayed normally, if the user refreshes and finds no application to be recommended, the listview header needs to be hidden. The first thought is:
Item_head.setvisibility (view. Gone );
Yes, the content does disappear, but the location is still occupied. A blank area is displayed on the page!
Some people say that setting the header neutron view to invisible; some say that setting the header neutron view height to 0; but I tested it here, it didn't work ..
My solutions:
Item_head.setpadding (0,-1 * headcontentheight, 0, 0); item_head.setvisibility (view. Gone );
Finally, I want to say that this problem really hurts! Record it here and make a memo!
Refer:
Http://stackoverflow.com/questions/4317778/hide-footer-view-in-listview
Http://blog.sina.com.cn/s/blog_70b9730f01014sgm.html