ViewAnimator使用说明

类图如下:

android.widget
类 ViewAnimator

java.lang.Object
  继承者 android.view.View
      继承者 android.view.ViewGroup
          继承者 android.widget.FrameLayout
              继承者 android.widget.ViewAnimator
所有已实现的接口:
Drawable.Callback, KeyEvent.Callback, ViewManager, ViewParent
直接已知子类:
ViewFlipper, ViewSwitcher




框架图

作用为FrameLayout里面的View切换提供动画效果.


 getDisplayedChild()

 

         public int getDisplayedChild ()

         返回当前显示的子视图的索引

 

         public Animation getInAnimation ()

         返回被用来显示视图进入屏幕的动画

                   返回值

                            一个动画对象animation,如果没有设置的话,返回一个null

                   参见

                       setInAnimation(android.view.animation.Animation)

                       setInAnimation(android.content.Context, int)

 

         public Animation getOutAnimation ()

返回被用来显示视图离开屏幕的动画

                   返回值

                            一个动画对象animation,如果没有设置的话,返回一个null

                   参见

                            setOutAnimation(android.view.animation.Animation)

                            setOutAnimation(android.content.Context, int)

 

         public void removeAllViews ()

         调用此方法从ViewGroup中移除所有的子视图

 

         public void removeViewAt (int index)

         移除组(group)中指定位置上的视图

                   参数

                            index       需要移除的视图在组中的位置

 

         public void removeViewInLayout (View view)

         在布局时移除一个视图。当你需要在onLayout()中移除一个视图时,此方法很有用。

                   参数

                            view         要从组中移除的视图

 

         public void removeViews (int start, int count)

         从组中移除指定范围的视图

                   参数

                            start        要移除的多个视图在组中的开始位置

                            count       移除视图的数量

 

         public void removeViewsInLayout (int start, int count)

         在布局时移除一组视图。当你需要在onLayout()中移除很多视图时,此方法很有用。

                   参数

                            start        移除的多个视图在组中第一个视图的索引

                            count       移除视图的数量

 

         public void setAnimateFirstView (boolean animate)

         设置当前视图在首次加载时是否动画显示。

                   参数

                            animate 在第一次显示当前视图时,是否动画显示

 

         public void setDisplayedChild (int whichChild)

         设置哪个子视图将被显示出来

                   参数

                            whichChild      将要显示的子视图的索引

 

         public void setInAnimation (Animation inAnimation)

         设置视图进入屏幕时使用的动画。

                   参数

                            inAnimation    视图进入屏幕时使用的动画                  

                   参见

                            getInAnimation()

                            setInAnimation(android.content.Context, int)

 

         public void setInAnimation (Context context, int resourceID)

         设置视图进入屏幕时使用的动画。

                   参数

                            context   上下文

                            resourceID      动画的资源id

                   参见

                            getInAnimation()

                            setInAnimation(android.view.animation.Animation)

 

         public void setOutAnimation (Animation outAnimation)

         设置视图退出屏幕时使用的动画

                   参数

                            outAnimation          当视图退出屏幕时开始的动画

                   参见

                            getOutAnimation()

                            setOutAnimation(android.content.Context, int)

 

         public void setOutAnimation (Context context, int resourceID)

         设置视图退出屏幕时使用的动画

                   参数

                            context   上下文

                            resourceID      动画的资源id

                   参见

                            getOutAnimation()

                            setOutAnimation(android.view.animation.Animation)

 

         public void showNext ()

         手动显示下一个子视图

 

         public void showPrevious ()

         手动显示上一个子视图



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值