Достижение Verticle Recyclerview с горизонтальным Recyclerview в виде файла строки - PullRequest
1 голос
/ 10 января 2020

Я хочу добиться чего-то подобного something like this

Я пытался сделать горизонтальный просмотр в виде строки в качестве файла строки вертикального просмотра, но я не смог добиться горизонтальной прокрутки.

Это будет здорово, если кто-нибудь мне поможет

Вот код

<?xml version="1.0" encoding="utf-8"?>

<androidx.core.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    android:background="@color/colorPrimaryDark">

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

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_player"
            android:layout_width="0dp"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            android:layout_height="match_parent"
            android:layout_weight="3" />

        <HorizontalScrollView
            android:id="@+id/horizontal"
            android:layout_width="0dp"
            android:layout_weight="7"
            android:fillViewport="true"
            android:layout_height="match_parent">

            <LinearLayout
                android:id="@+id/lin_main"
                android:layout_width="wrap_content"
                android:orientation="vertical"
                android:layout_height="wrap_content">

            </LinearLayout>

        </HorizontalScrollView>

    </LinearLayout>

</androidx.core.widget.NestedScrollView>

Здесь я пытаюсь добавить динами c представления в LinearLyout (lin_main)

1 Ответ

0 голосов
/ 10 января 2020

Создайте свой ITEM_LAYOUT, для которого вы устанавливаете его в режиме рециркуляции, следующим образом.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="horizontal">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:orientation="vertical"
        android:padding="@dimen/_8sdp">

    //YOUR VIEWS HERE

    </LinearLayout>

    <ScrollView  
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content">

       <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity=""
        android:orientation="horizontal"
        android:padding="@dimen/_8sdp">

        //YOUR HORIZONTAL SCROLL VIEWS COMPONENT

        </LinearLayout>

    </ScrollView>
</LinearLayout>

Надеюсь, это поможет. Для получения более подробной информации поделитесь файлом UI xml здесь.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...