RecyclerView 顯示不全的問題.


在實際項目中,發現RecyclerView控件,在顯示時,下拉中,沒有顯示全,比如64卦,只顯示了48卦,解決辦法是在布局文件中,在RecyclerView的外面,再包裹一層線性布局,即可。完成時代碼如下:

 

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"> //讓其直接獲取焦點,可以不加。帶驗證。
    <android.support.v7.widget.RecyclerView android:id="@+id/rv_all_list" android:layout_width="395dp" android:layout_height="715dp" android:scrollbars="vertical" tools:layout_editor_absoluteX="8dp" tools:layout_editor_absoluteY="8dp" tools:listitem="@layout/recycler_view_item" />
</RelativeLayout>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM