OverScrollDecor

over-scrolling效果
授权协议 未知
开发语言 Java
所属分类 iOS代码库、 滚动视图(ScrollView)
软件类型 开源软件
地区 国产
投 递 者 公孙霖
操作系统 Android
开源组织
适用人群 未知
 软件概览

OverScrollDecor是一款类似IOS的over-scrolling效果的软件,即对于滑动到顶部的View继续滑动时会超出,松手后自动还原到原始位置。支持ListView,GridView,ScrollView,WebView,RecyclerView,以及其他的任意View和ViewGroup。

演示:


用法:

使用前,对于Android Studio的用户,可以选择添加:

 compile project(':library_overscroll')

实现原理:

采用ViewDragHelper 和重写布局的 dispatchTouchEvent实现。

代码参考:

使用简单,Java代码无需做任何修改,需要要将想要实现效果的布局外包一层OverScrollDecor即可。对于 ListView,GridView,ScrollView,WebView,RecyclerView 五个类需要使用该项目中提供的 Vertical开头的对应类,其余View 和 ViewGroup 使用原生即可。如果是自定义的 ListView(其余类似),只需要将你自定义的ListView 继承 VerticalListView ,在不修改代码的情况下同样可以实现。

 <?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">

        <com.lzy.ui.OverScrollDecor            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.lzy.ui.VerticalListView                android:id="@+id/listView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>
        </com.lzy.ui.OverScrollDecor>
</RelativeLayout>
 相关资料
  • To make the grid scrollable, set constant width and height to the container holding Handsontable and set the overflow property to hidden in the container's stylesheet. Then, if the table contains enou

  • Many apps feature lists of content, from email clients to music apps and beyond. In order to verify that lists contain the content we expect using integration tests, we need a way to scroll through li

  • Scroll multiple widgets as children of the parent. See more widgets in the widget catalog. GridView A grid list consists of a repeated pattern of cells arrayed in a vertical and horizontal layout. The

  • Scrolling Tabs 是一个具有滚动效果的 Tab 控件。可以自动调整 Tab 的大小。

  • 列表对于显示批量数据或提供一组可供选择的选项非常有用。 <!-- in your app-content --> <ul class="app-list"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> 另外,列表项可以是按钮。 <ul class="app-list"> <li class="app-button">B

  • CSS实现滚动视差 何为滚动视差 视差滚动(Parallax Scrolling)是指让多层背景以不同的速度移动,形成立体的运动效果,带来非常出色的视觉体验。 作为网页设计的热点趋势,越来越多的网站应用了这项技术。 通常而言,滚动视差在前端需要辅助 Javascript 才能实现。当然,其实 CSS 在实现滚动视差效果方面,也有着不俗的能力。下面就让我们来见识一二: 认识 background-a

  • 利用UILabel实现滚动字幕的效果。 [Code4App.com]

  • Kinetic Scrolling Plugin for Phaser Framework The vertical and horizontal scrolling is a very useful feature in the games for example to display a section of levels and with this plugin you can simula