Android--recycleview滾動條

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        <!-- 滾動條的寬度-->
        android:scrollbarSize="3dp"
        <!-- 滾動條是垂直方向 -->
        android:scrollbars="vertical"
        <!-- 設置滾動條的樣式 -->
        android:scrollbarThumbVertical="@drawable/scroll_bar"
        <!-- 設置滾動條默認情況下顯示 -->
        android:fadeScrollbars="false"
        />

</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        <!-- 指定高度 -->
        android:height="66dp"
        <!-- 距離底部 -->
        android:bottom="8dp"
        <!-- 距離頂部 -->
        android:top="3dp">
        <shape>
            <!-- 圓角 -->
            <corners android:radius="18dp"/>
            <!-- 填充顏色 -->
            <solid android:color="@color/background"/>
        </shape>
    </item>
</layer-list>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章