Эй, ребята, я немного новичок в программировании на андроиде, но, похоже, я не могу получить свой просмотр в моем рабочем столе. Я использую мой viewpager с tablayout и на одной из страниц, у меня есть recyclerview, который содержит карты с динамически созданным контентом внутри каждого из них (каждый вид карты будет иметь разную высоту на основе содержимого внутри). Проблема, с которой я сейчас сталкиваюсь, заключается в том, что высота моего recycleriew распространяется только на высоту viewpager, даже если в кармане внутри моего recyclerview слишком много контента для размещения на экране viewpager.Recyclerview in viewpager только расширяет длину viewpager
Как видно из рисунка, мой cardview взял на весь экран, но у меня есть еще несколько упражнений в моем списке упражнений, которые я использовал, чтобы созданный в cardview и они отрезаны ..
Ниже мой XML для деятельности, которая содержит мой взгляд пейджер, XML, для фрагмента ViewPager, а также XML для моего cardview
активности с моим ViewPager
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/view"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/view">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"/>
</android.support.design.widget.AppBarLayout>
</RelativeLayout>
фрагмент ViewPager с recyclerview
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.davidyuan7536.workoutlog.LogFragment"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/homeFeedRecycleView" />
</LinearLayout>
cardview внутри recyclerview
<?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="match_parent"
android:padding="16dp"
>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cv"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:background="@color/homeFeedUserHeaderBackground">
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:id="@+id/homeFeedUserAvatar"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="16dp"
android:src="@drawable/profile_icon"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/homeFeedUserName"
android:layout_toRightOf="@+id/homeFeedUserAvatar"
android:layout_alignParentTop="true"
android:textSize="20sp"
android:text="User Name"
android:singleLine="true"
android:ellipsize="end"
android:layout_marginRight="10dp"
android:textColor="@color/textColorPrimary"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/homeFeedWorkoutTitle"
android:layout_toRightOf="@+id/homeFeedUserAvatar"
android:layout_below="@+id/homeFeedUserName"
android:text="Workout Titile"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:textSize="15sp"
android:textColor="@color/textColorPrimary"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/homeFeedExercisesContainer"
android:paddingBottom="10dp">
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
Вы говорите, что просмотр ресайклера не прокручивается до других видов карт? – CodeCody
@CodeCody нет, но карты внутри отсекаются. Как в theres больше контента, который должен отображаться, но он не делает. –