弹性滑动原理
将一次大的滑动非为若干次小的滑动,并在一个时间段内完成。更好的用户体验
实现方式很多种,包括用Scroller,动画,延时策略.
使用Handler实现弹性滑动
效果可以看到按钮Button向滑动。注意这里是将View的内容改变。
你可以试一试将Button外层的RelitiveLayout去掉,把id放在Button下。发现是Button的文字滑动
<RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
android:layout_width=match_parent