いくつかの画像とリストビューを持つビューページをいくつかのデータで表示するアクティビティをプログラムしようとしていますが、私の問題はリストビューの最後の部分だけをスクロールできることです私はリストビューとviewpagerをスクロール可能にしたかった画面はので、私はここに私のXMLファイルViewPagerをlistViewにヘッダとして追加する
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<com.devsmart.android.ui.HorizontalListView
android:id="@+id/sectionsList"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:background="@drawable/menu_bg" />
<include layout="@layout/main_screen_components" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
だと私は私のクラスでこれを書く。..ヘッダとしてそれを置くことについて考え
@Override
protected void onPostExecute(List<News> result) {
Utils.pagerNews(result);
Utils.listNews(result);
ImagePagerAdapter pAdapter = new ImagePagerAdapter(
appManager.getPagerNews());
pager.setAdapter(pAdapter);
View headerView = getLayoutInflater().inflate(R.layout.main_screen_components , null , false);
NewsListAdapter adapter = new NewsListAdapter(getBaseContext(),
appManager.getListNews());
listView.addHeaderView(headerView);
listView.setAdapter(adapter);
progress.dismiss();
}
私はこのコードを実行すると、重複したページャーを提供します。データと空のリストビューのヘッダーとして固定されています。ポケットベルにアダプターを設定しようとすると、 .. 何か案が ?このような
あなたは私の一日保存しました!これは魅力のように機能します。 – Antonio
あなたも私の日を救った!これは素晴らしいです〜 – daimajia
@eric私はこの機能を理解する問題に直面しています。この関数は、アクションが少なくてもfalseを返します。そして、dowpとcurPはちょうど初期化されていますが、dowpとcurPのx、yが0で常に等しいことを意味する値の変化はありません。 –