2016-11-17 37 views
0

我一直在這個問題上停留了幾天,並試圖在這裏找遍,並嘗試了很多沒有工作的東西。基本上,我有我的RecyclerView Look at bottom and top of each text underneath My favourite topicsRecyclerView項目差距太大

以下項目之間的巨大差距是我RecyclerView

<android.support.v7.widget.RecyclerView 
    android:id="@+id/favouriteTopicRecycler" 
    android:layout_width="match_parent" 
    android:layout_height="150dp" 
    android:paddingStart="12dp" 
    android:layout_marginTop="10dp" 
    android:visibility="gone"/> 

代碼,這裏是爲RecyclerView

<TextView 
    android:id="@+id/favTextView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textColor="@android:color/white" 
    android:background="@android:color/transparent" 
    android:textSize="12sp" 
    android:clickable="true" /> 

我真不」列表項不知道我做錯了什麼,任何人都可以幫忙嗎?先謝謝你。

+0

做列表項中的父標籤高度是match_parent?如果是,那麼使它wrap_content和問題將得到解決。 –

+0

@RakshitNawani工作謝謝你! – BilalMH

回答

1

列表項高度中的父標記是否爲match_parent?如果是的話,請使其wrap_content並且問題將得到解決。 在更新後的回收視圖gradle中,如果項目匹配父項,它會佔用整個頁面的高度,通過執行wrap_content它將解決您的問題。