Я работаю с Android Studio и проектирую макет, как показано ниже. Однако в моем ListView lv_comics отображено достаточно места для 1 элемента. Я попытался установить layout_height для fill_parent, но он все равно не работает. Однако, когда я устанавливаю layout_height в определенный размер, это нормально, но это плохо, когда я переключаюсь на другой размер экрана. Кто-нибудь может мне помочь?Android - Высота ListView просто подходит 1 ListView item
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/layout_swiperefresh"
android:background="@color/grey">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Latest Update"
android:textColor="@color/white"
android:background="@color/indigo_main"
android:textSize="10dp"/>
<Gallery
android:id="@+id/gallery1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Most Popular"
android:textColor="@color/white"
android:background="@color/indigo_main"
android:textSize="10dp"/>
<Gallery
android:id="@+id/gallery2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="New Manga"
android:textColor="@color/white"
android:background="@color/indigo_main"
android:textSize="10dp"/>
<ListView
android:drawSelectorOnTop="true"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/lv_comics" />
</LinearLayout>
</ScrollView>
Вот мой макет шоу. http://i.stack.imgur.com/KFIJy.jpg
'' ListView' внутри ScrollView' ...? Не хорошая идея. –
Listview внутри scrollview - не очень хорошая идея. Чтобы обойти это, вы можете добавить свои два представления в качестве заголовков в список – Eoin