我想這傢伙的solution和它的作品(代碼是基於pulltorefresh):
的XML佈局(header.xml):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ProgressBar
style="@android:style/Widget.ProgressBar.Small.Inverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="16dp"
android:layout_marginTop="2dp" />
</RelativeLayout>
</LinearLayout>
當創建視圖:
m_headerView = inflater.inflate(R.layout.header, this, false);
如果你想展示它,請這樣做:
m_headerView.setPadding(0, 0, 0, 0);
m_headerView.setVisibility(View.VISIBLE);
,如果你想隱藏它,這樣做:
m_headerView.setPadding(0, -1000, 0, 0);
m_headerView.setVisibility(View.GONE);
它完全在我們的project.hope很有幫助。
你可以發佈一些佈局XML或代碼? – 2012-07-26 22:10:13
你有什麼解決方案嗎? – 2012-09-05 18:22:44
以下會幫助你嗎? http://stackoverflow.com/questions/4961999/remove-bottom-divider-of-a-android-listview – Xebozone 2014-11-17 18:54:26