NineOldAndroids在level 11以下的版本中实现view动画
2014-12-03 15:49
471 查看
NineOldAndroids项目: http://nineoldandroids.com/
在level 11以上的系统版本中,可以用以下方法实现view平移、透明度
在level 11以上的系统版本中,可以用以下方法实现view平移、透明度
text1.setTranslationX(-600 * arg1); text1.setAlpha(1 - Math.abs(arg1)); text2.setTranslationX(-200 * arg1); text2.setAlpha(1 - Math.abs(arg1)); text3.setTranslationX(-400 * arg1); text3.setAlpha(1 - Math.abs(arg1));但是这些方法不能在level 11以下的版本中使用,所有为了解决这个问题,可以引用NineOldAndroids来实现同样的效果
ViewPropertyAnimator.animate(text1).setDuration(0).translationX(-600*arg1); ViewPropertyAnimator.animate(text2).setDuration(0).translationX(-200*arg1); ViewPropertyAnimator.animate(text3).setDuration(0).translationX(-400*arg1); ViewPropertyAnimator.animate(text1).setDuration(0).alpha(1 - Math.abs(arg1)); ViewPropertyAnimator.animate(text2).setDuration(0).alpha(1 - Math.abs(arg1)); ViewPropertyAnimator.animate(text3).setDuration(0).alpha(1 - Math.abs(arg1));
相关文章推荐
- Android 之nineoldandroids ViewHelper实现动画效果
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- android 在使用ViewAnimationUtils.createCircularReveal()无法兼容低版本的情况下,另行实现圆形scale动画
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- 出场、入场动画大全,基于NineOldAndroids轻松实现动画效果
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android-个性通知(开源niftynotification,eclipse实现调用,nineoldandroids动画)
- Android实现一键复制粘贴,兼容低版本系统(api 11以下)
- Android中通过ViewHelper.setTranslationY实现View移动控制(NineOldAndroids开源项目)
- 【Android】实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android中通过ViewHelper.setTranslationY实现View移动控制(NineOldAndroids开源项目)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)
- Android 实现个性的ViewPager切换动画 实战PageTransformer(兼容Android3.0以下)