如何创建采用九老机器人动画ImageView的脉冲效应 [英] How to create ImageView pulse effect using nine old androids animation

查看:122
本文介绍了如何创建采用九老机器人动画ImageView的脉冲效应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我应该如何创建采用九OLAD机器人框架动画的脉冲效应。

I wonder how I should create a pulse effect using nine olad androids framework animation.

要更好地理解可以说你有一个ImageView的,并希望有一个脉冲效应一样 使图像有点小​​,然后再返回到原来的大小,缩放将居中

To understand better lets say you have an ImageView and want to have a "pulse" effect like make the image little smaller and then back to original size, scaling will be centered.

我用9 OLAD机器人的向后兼容性。

I use nine olad androids for backward compatibility.

任何其他的选择是值得欢迎的。

Any other option is welcome.

感谢你。

推荐答案

R.anim.pulse

<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="1000"
    android:fromXScale="1"
    android:fromYScale="1"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="1"
    android:repeatMode="reverse"
    android:toXScale="0.5"
    android:toYScale="0.5" />

ImageView imageView = (ImageView) findViewById(R.id.image);
Animation pulse = AnimationUtils.loadAnimation(this, R.anim.pulse);
imageView.startAnimation(pulse);

这篇关于如何创建采用九老机器人动画ImageView的脉冲效应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆