亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Android如何在一個活動中一個接一個地顯示2個列表視圖

Android如何在一個活動中一個接一個地顯示2個列表視圖

繁花不似錦 2019-11-13 14:58:39
我已使用此代碼在另一個頂部顯示2個列表視圖。<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><ListView    android:id="@+id/listView1"    android:layout_width="match_parent"    android:layout_height="fill_parent"    android:layout_weight="1"    android:background="#f00" ></ListView><ListView    android:id="@+id/listView2"    android:layout_width="match_parent"    android:layout_height="fill_parent"    android:layout_weight="1"    android:background="#0f0" ></ListView>問題是,這導致2個列表視圖各自占據屏幕的一半。我將標題添加到兩個這樣的列表。LevelAdapter adapter = new LevelAdapter(getActivity(),            R.layout.list_item, weather_data);    View header = inflater.inflate(R.layout.header2, null);    View header2 = inflater.inflate(R.layout.header, null);   lv1.addHeaderView(header);   lv2.addHeaderView(header2);    lv1.setAdapter(adapter);    lv2.setAdapter(adapter);我希望第二個列表的標題在第一個列表結束后出現。我該如何做?如何使列表視圖出現,從而使第二個視圖在第一個視圖結束時開始?謝謝
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 407 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號