手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >Android实现Flip翻转动画效果
Android实现Flip翻转动画效果
摘要:本文实例讲述了Android实现Flip翻转动画效果的方法,分享给大家供大家学习借鉴。具体实现代码如下:LinearLayoutlocati...

本文实例讲述了Android实现Flip翻转动画效果的方法,分享给大家供大家学习借鉴。

具体实现代码如下:

LinearLayout locationLL = (LinearLayout) findViewById(R.id.locationLL); LinearLayout baseLL = (LinearLayout) findViewById(R.id.baseLL); private void flipit() { Interpolator accelerator = new AccelerateInterpolator(); Interpolator decelerator = new DecelerateInterpolator(); final LinearLayout visibleList,invisibleList; final ObjectAnimator visToInvis, invisToVis; if (locationLL.getVisibility() == View.GONE) { visibleList = baseLL; invisibleList = locationLL; visToInvis = ObjectAnimator.ofFloat(visibleList, "rotationY", 0f, 90f); invisToVis = ObjectAnimator.ofFloat(invisibleList, "rotationY", -90f, 0f); } else { invisibleList = baseLL; visibleList = locationLL; visToInvis = ObjectAnimator.ofFloat(visibleList, "rotationY", 0f, -90f); invisToVis = ObjectAnimator.ofFloat(invisibleList, "rotationY", 90f, 0f); } visToInvis.setDuration(300); invisToVis.setDuration(300); visToInvis.setInterpolator(accelerator); invisToVis.setInterpolator(decelerator); visToInvis.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator anim) { visibleList.setVisibility(View.GONE); invisToVis.start(); invisibleList.setVisibility(View.VISIBLE); } }); visToInvis.start(); }

希望本文所述实例对大家Android程序设计能有一定的帮助。

【Android实现Flip翻转动画效果】相关文章:

android实现listview分页的方法

Android中实现水平滑动(横向滑动)ListView示例

Android中的Button自定义点击效果实例代码

Android列表实现(1)_数组列表实例介绍

Android实现Activities之间进行数据传递的方法

Android中实现EditText圆角的方法

Android 九宫格的实现方法

android自动更新软件版本

Android 使用XML做动画UI的深入解析

android Watchdog 实现剖析

精品推荐
分类导航