改用ConstraintLayout后,嵌入RecyclerView,发现RecyclerView的item最后一个item总是显示一半;
解决方法:将RecyclerView或者ScrollView的宽高设为0dp
<RecyclerView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar">
网友评论