首页 > 代码库 > ListView隐藏HeadView

ListView隐藏HeadView

把HeadView及其子View的Visibility都设置成GONE就行了,只设置HeadView的Visibility不行;

private void setHeadViewVisibility(int visibility){    headlineView.setVisibility(visibility);    int childCount=headlineView.getChildCount();    for (int i = 0; i <childCount; i++) {        headlineView.getChildAt(i).setVisibility(visibility);    }}