完美解決隱藏Listview和RecyclerView去掉滾動(dòng)條和滑動(dòng)到邊界陰影的方案

完美解決隱藏Listview和RecyclerView去掉滾動(dòng)條和滑動(dòng)到邊界陰影的方案

轉(zhuǎn)自:https://blog.csdn.net/ming2316780/article/details/51578621

一、首先是Listview的屬性設(shè)置

設(shè)置滑動(dòng)到頂部和底部的背景或顏色:

android:overScrollFooter="@android:color/transparent"
android:overScrollHeader="@android:color/transparent"

設(shè)置滑動(dòng)到邊緣時(shí)無效果模式:

android:overScrollMode="never"

設(shè)置滾動(dòng)條不顯示:

android:scrollbars="none"

以下是整體設(shè)置(overScrollHeader和overScrollFooter可不寫,此處寫了是引用的透明色)

<ListView
    android:id="@+id/lv_type"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:overScrollFooter="@android:color/transparent"
    android:overScrollHeader="@android:color/transparent"
    android:overScrollMode="never"
    android:scrollbars="none">

二、RecyclerView的屬性設(shè)置

以下是整體設(shè)置:

<android.support.v7.widget.RecyclerView
    android:id="@+id/rv_search_one"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:overScrollMode="never"
    android:scrollbars="none" />
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容