私は2つのListView
を1つのLinearLayout
に入れました。 LinearLayoutの背景は描画可能です。すべて正常に動作していますが、ListViewのいずれかで飛んでいると、背景画像が消え、黒い背景が表示されます。フライミングが停止すると、画像が背景として再び表示されます。私はバックグラウンドを変えたくありません。間違っていますか?ListViewの背景の変更onFling
レイアウトは、以下の通りである:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:text="Upcoming Trips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/top_blue_box"
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="16sp"
android:layout_gravity="center"
/>
<ListView
android:id="@+id/upList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="2"
/>
<TextView
android:text="Past Trips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bottom_box"
android:textColor="#ffffff"
android:textStyle="bold"
android:textSize="16sp"
android:layout_gravity="center_horizontal"
/>
<ListView
android:id="@+id/downList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="2"
/>
</LinearLayout>
EDIT: 溶液は、詳細にロビンフッドのおかげhereを説明します。
おかげで、それが働いた:) – noob