灵动的菜单展开效果
2016-02-29 12:55
267 查看
大家先来看看效果
首先我们分析,如何能实现这样的交互,因为展开后我们需要点击 所以这里肯定不能用视图动画 只能使用属性动画,其次我们需要对不同的图片按钮设置一个展开、合拢的效果。
这样我们就行实现上面的效果了
首先我们分析,如何能实现这样的交互,因为展开后我们需要点击 所以这里肯定不能用视图动画 只能使用属性动画,其次我们需要对不同的图片按钮设置一个展开、合拢的效果。
/** * 开启一个动画 */ private void startAnim() { ObjectAnimator animator0=ObjectAnimator.ofFloat(imageView,"alpha",1F,0.5F); ObjectAnimator animator1=ObjectAnimator.ofFloat(imageView5,"translationY",200F); ObjectAnimator animator2=ObjectAnimator.ofFloat(imageView3,"translationX",200F); ObjectAnimator animator3=ObjectAnimator.ofFloat(imageView4,"translationY",-200F); ObjectAnimator animator4=ObjectAnimator.ofFloat(imageView2,"translationX",-200F); AnimatorSet set=new AnimatorSet(); set.setDuration(500); set.setInterpolator(new BounceInterpolator()); set.playTogether(animator0,animator1,animator2,animator3,animator4); set.start(); }
这样我们就行实现上面的效果了
相关文章推荐
- Android Activity学习 <一> Activity基础知识和生命周期
- mysql连接数设置
- 运算符优先级
- servlet之ServletContext
- 导致实例逐出的五大问题 (文档 ID 1526186.1)
- 同事写的二分归并排序
- LinearLayout 动态添加子Button,并自动换行
- 体检套餐管理系统的综合版
- ClipDrawable的使用--慢慢展开的图片
- mybatis逆向工程
- leetcode-- Lowest Common Ancestor of a Binary Search Tree
- 大数据论坛
- ASCII码对照表
- ABAP - 日期格式转换 & ABAP经常使用日期处理函数
- HBase快照、Snapshots 淘宝快照
- asp.net 母版页使用详解
- 矩形
- Netmap 高性能网络I/O框架
- 如何诊断 11.2 集群节点驱逐问题 (文档 ID 1674872.1) 转到底部转到底部
- Python中用format函数格式化字符串的用法