У меня есть два ListView
с в одном LinearLayout
.Фон LinearLayout является рисованным.Все работает нормально, но когда я переключаюсь на любой из ListView, фоновое изображение исчезает, и черный фон отображается.Когда бросание прекращается, изображение снова отображается в качестве фона.Я не хочу менять фон, я что-то не так делаю?
Макет выглядит следующим образом:
<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>
РЕДАКТИРОВАТЬ: Решение объяснено здесь в деталях, благодаря Robinhood.