2016-04-07 8 views
0

Androidサポートライブラリ用の新しいアップデートをバージョン23.2.1.0にインストールしたばかりです。プロジェクトを実行したとき、以前にはなかった問題に直面しています。私はフラグメントの内部で膨張されたrecyclerviewコンテナの内側に表示されるカードビューを使用しています。これらのカードビューは、リストアイテム間に広いギャップを持っています。すべてのリサイクル業者には同じ問題があるようです。リサイクルビュー間の広いギャップ

recyclerviewコンテナのコー​​ド次の通りである:リスト項目のコードは以下である

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <android.support.v7.widget.RecyclerView 
     android:id="@+id/rv" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior" 
     android:scrollbars="vertical" /> 
    <ProgressBar 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/progressBar" 
     android:layout_centerInParent="true" 
     android:layout_marginTop="20dp" 
     android:background="@drawable/ProgressBarStyle" 
     android:visibility="invisible" /> 
</RelativeLayout> 

<?xml version="1.0" encoding="utf-8"?> 
<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" 
    android:padding="0dp"> 
    <android.support.v7.widget.CardView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:cardPreventCornerOverlap="false" 
     app:cardUseCompatPadding="false" 
     android:id="@+id/cv"> 
     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:padding="16dp"> 
      <refractored.controls.CircleImageView 
       android:layout_width="50dp" 
       android:layout_height="50dp" 
       android:id="@+id/person_photo" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentTop="true" 
       android:layout_marginRight="16dp" 
       android:src="@drawable/profile2" /> 
      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/person_name" 
       android:layout_toRightOf="@+id/person_photo" 
       android:layout_marginTop="10dp" 
       android:textStyle="bold" 
       android:layout_alignParentTop="false" 
       android:textSize="20sp" /> 
     </RelativeLayout> 
    </android.support.v7.widget.CardView> 
</LinearLayout> 

すべてが更新前の罰金ました。私は更新がすべてを混乱させた理由を知りました。これは、リスト項目の表示方法です。他のアイテムを表示するには上下にスクロールする必要があります。

enter image description here

+0

を確認してください。http://stackoverflow.com/questions/35728179/recyclerview-items-with-big-empty-space-after-23-2-0 –

答えて

3

wrap_contentにあなたのListItem XML内のルートLinearLayoutの高さを設定してみてください。

+0

よろしいですか。それがそれを解決しました。ありがとう、相棒!以前のバージョンでは、メインラッパーのフルハイトは表示されず、内部のコンテンツのみがリサイクルリストビューに表示されていました。 –

+0

Omg、これは私を助けました。どうもありがとうございます。しかし、説明は何ですか? – Recomer

+0

checkout http://stackoverflow.com/a/35728185/4321808 –

関連する問題