这是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/featuredContent"
android:layout_width="fill_parent"
android:layout_height="150dp"
android:background="#ccc"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/panelpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</LinearLayout>
我已经在我的ListView中实现了 AbsListView.OnScrollListener并且我可以拥有第一项的 Y,但是如何在滚动到底部时隐藏featuresContent以便我可以在整个屏幕中看到 ListView?
listNews.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
View firstItem = listNews.getChildAt(0);
int top = (firstItem == null) ? 0 : firstItem.getTop();
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
});