在Android中的Webview上向上滑动并向下滑动动画

rah*_*pra 6 animation android slide webview updown

我有一个列表中的章节列表.当用户选择一个章节时,它会被扩展,并且该章节中的子主题列出.当用户选择特定子主题时,其内容将在新屏幕上的webview中加载.一切都很好.但我想在webview上使用一些功能.当用户向上滑动webview时,webview应向上移动,并且屏幕上将显示从底部到上部的新webview(在webview上向上滑动动画)以及下一个子主题内容.当用户向下滑动具有先前子主题内容的web视图时,向下滑动的情况相同.

请帮助如何在webview上提供向上滑动和向下滑动的动画.谢谢

Dha*_*ant 12

将动画应用于webview ..

向下滑动

<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android">

<translate android:fromYDelta="0%p"   
          android:interpolator="@android:anim/accelerate_interpolator"      
    android:toYDelta="100%p" android:duration="2000" />  
</set>
Run Code Online (Sandbox Code Playgroud)

向上滑动

<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">

<translate android:fromYDelta="100%" 
                   android:toXDelta="0" 
                   android:duration="1000" />
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="500" />
</set>
Run Code Online (Sandbox Code Playgroud)

使用Wbeview startAnimation方法