ScrollView с GridView без прокрутки вниз - PullRequest
0 голосов
/ 28 ноября 2018
    <ScrollView
    android:id="@+id/verticalScrollView_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    app:layout_constraintTop_toBottomOf="@id/pets_for_sale_text">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <GridView
            android:id="@+id/listing_GridViewLayout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:numColumns="auto_fit"
            android:padding="5dp"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">
        </GridView>
        <!--<View-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="400dp"-->
            <!--android:layout_below="@id/listing_GridViewLayout"-->
        <!--android:layout_marginTop="0dp"-->
        <!--android:id="@+id/simulate_bottom_margin_view" />-->
    </LinearLayout>
</ScrollView>

Я пробовал много решений, включая добавление отступов к ScrollView или к LinerLayout, которые ничего не делают.Также попытался добавить дополнительный вид внизу, чтобы создать этот дополнительный отступ, также ничего не делает.Любая помощь / предложение будет высоко ценится.

(посмотрите на вторую сетку, чтобы понять, в чем проблема, 1-я сетка - результат, которого я пытаюсь достичь)

Ответы [ 3 ]

0 голосов
/ 28 ноября 2018

Пожалуйста, попробуйте изменить ваш рост Scrollview на Match_parent

0 голосов
/ 04 декабря 2018

хорошо, решение, которое работало для меня, было добавить «app: layout_constraintBottom_toTopOf» в сетку, чтобы оно оставалось поверх отображаемой панели инструментов.Спасибо за ответы.

0 голосов
/ 28 ноября 2018

установите это внутри элемента макета GridView:

android:nestedScrollingEnabled="false"
...