在横向规则下面应该有一个标题说预告片 它被切断了。我不知道为什么。
这里是完整的页面xml
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- should include the movie details -->
<include layout="@layout/primary_detail_info"/>
<ProgressBar
android:layout_width="42dp"
android:layout_height="42dp"
android:id="@+id/pb_loading_bar"
android:layout_gravity="center"
android:visibility="invisible"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview_movie_trailers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingBottom="0dp"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview_movie_reviews"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingBottom="8dp"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</FrameLayout>
这里包含了primary_detail_info.xml:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="uk.co.pottertour.popularmovieswithdb.DetailActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:background="@color/colorPrimaryDark"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingStart="16dp"
android:textColor="@android:color/white"
android:textSize="30sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Chappie" />
<ImageView
android:layout_width="185dp"
android:layout_height="270dp"
android:id="@+id/iv_detail_poster_thumbnail"
tools:layout_editor_absoluteY="41dp"
tools:layout_editor_absoluteX="0dp"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
app:layout_constraintStart_toStartOf="parent"
android:padding="8dp"
android:contentDescription="@string/movie_poster"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_release_date"
android:textSize="25sp"
app:layout_constraintLeft_toRightOf="@+id/iv_detail_poster_thumbnail"
app:layout_constraintTop_toBottomOf="@+id/tv_title"
android:layout_margin="8dp"
tools:text="Release date"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv_vote_average"
android:textSize="14sp"
app:layout_constraintLeft_toRightOf="@+id/iv_detail_poster_thumbnail"
app:layout_constraintTop_toBottomOf="@+id/tv_release_date"
android:layout_margin="8dp"
android:padding="8dp"
tools:text="8.1/10"/>
<ToggleButton
android:id="@+id/button_favourite"
android:onClick="onclick_favourite_button"
android:background="@drawable/favourite_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:fontFamily="sans-serif-smallcaps"
android:padding="8dp"
android:textOn="Mark as\nfavourite"
android:textOff="Mark as\nfavourite"
android:textSize="14sp"
app:layout_constraintLeft_toRightOf="@+id/iv_detail_poster_thumbnail"
app:layout_constraintTop_toBottomOf="@+id/tv_vote_average"
android:checked="false"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_overview"
tools:layout_editor_absoluteX="0dp"
app:layout_constraintTop_toBottomOf="@+id/iv_detail_poster_thumbnail"
app:layout_constraintStart_toStartOf="parent"
android:layout_margin="8dp"
tools:text="Synopsis Blah blah blah"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:paddingBottom="0dp"
app:layout_constraintTop_toBottomOf="@+id/tv_overview"
app:layout_constraintStart_toStartOf="parent"
android:background="@android:color/darker_gray"
android:id="@+id/black_rule"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_trailers_label"
tools:layout_editor_absoluteX="0dp"
app:layout_constraintTop_toBottomOf="@+id/black_rule"
app:layout_constraintStart_toStartOf="parent"
android:layout_margin="8dp"
android:textSize="18sp"
android:text="Trailers:"/>
</android.support.constraint.ConstraintLayout>
</ScrollView>
</layout>
所有的高度都设置为wrap_content,所以真的不知道,谷歌没有帮助这些搜索条件,喜欢一些想法。