您的位置:首页 > 其它

AdapterViewFlipper 和 StackView的使用

2015-11-07 14:36 309 查看
AdapterViewFlipping
自动播放的图片库
继承了 AdapterViewAnimator ,【Animator:动画】也会显示Adapter提供的多个View组件,但是每次只能显示一个组件

android.widget.AdapterViewAnimator的XML属性

android:animateFirstView Defines whether to animate the current View when the ViewAnimation is first displayed.  

设置显示该组件的第一个View时是否使用动画
android:inAnimation Identifier for the animation to use when a view is shown.  

设置组件显示时使用的动画
android:loopViews Defines whether the animator loops to the first view once it has reached the end of the list.  

设置循环到最后一个组件后,是否从头开始循环
android:outAnimation Identifier for the animation to use when a view is hidden.  

设置组件隐藏时使用的动画
AdapterViewAnimator的XML属性

android:autoStart When true, automatically start animating  Must be a boolean value, either "
true
" or "
false
".

设置组件是否自动播放。
android:flipIntervalsetFlipInterval(int) 
        
        
 
 设置自动播放的时间间隔          ms毫秒
几个重要的公共方法:
showPrevious()//显示上一个组件
showNext()//显示下一个组件
startFlipping()//开始自动播放组件
stopFlipping()//停止自动播放
isFlipping()//如果返回true  则说明对象正在自动播放

StackView
同AdapterViewFlipper相同,StackView也是AdapterViewAnimator的子类
他的作用也和AdapterViewFlipping类似,只不过StackView是使用堆叠“Stack”

它也具有 showNext() showPrevious() 方法 但不具备自动播放的方法
 我是看的《疯狂android讲义》学习的  所以暂时拿他当例子啦!


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: