以下是我zoom_in.xml的android:如何停止变焦重复动画
<set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" >
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="0"
android:fromYScale="0"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" >
</scale>
</set>
的观点是在三个时间变焦。我如何才能使它只有一次
PS:android:repeatCount="1"
不起作用。
编辑1:我的动画的Util具有负载动画作为如下因素
public static Animation loadAnimation(Context context, @AnimRes int id)
throws NotFoundException {
XmlResourceParser parser = null;
try {
parser = context.getResources().getAnimation(id);
return createAnimationFromXml(context, parser);
} catch (XmlPullParserException ex) {
NotFoundException rnf = new NotFoundException("Can't load animation resource ID #0x" +
Integer.toHexString(id));
rnf.initCause(ex);
throw rnf;
} catch (IOException ex) {
NotFoundException rnf = new NotFoundException("Can't load animation resource ID #0x" +
Integer.toHexString(id));
rnf.initCause(ex);
throw rnf;
} finally {
if (parser != null) parser.close();
}
我现在已经把它叫做如下使用 “设置” 的
zoomIn = loadAnimation(getContext(),
R.anim.zoom_in);
view.startAnimation(zoomIn);
如果您没有提及'android:repeatCount ='“1”' – ELITE
如果在代码中添加'AnimationListener',并在'onAnimationEnd'方法中停止动画,该怎么办。 – ELITE
如果我没有提及重复计数,它将放大3倍。如果我把重复计数也重复3次。 – MKY