ビューページャーにいくつかの画像といくつかのデータを含むリストビューを表示するアクティビティをプログラムしようとしています..しかし、私の問題は、ビューページャーをスクロール可能にしたかった画面の最後の部分でリストビューのみをスクロールできることですリストビューなので、ヘッダーとして配置することを考えました..これが私のXMLファイルです
<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();
}
このコードを実行すると、複製されたページャーが表示されます..データを含むページャーを修正し、リストビューのヘッダーとして空のページャーを..ページャーにアダプターを設定しようとするとクラッシュします。 。 何か案が ?