Es folgt mein zoom_in.xmlandroid: wie in der Animation
<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>
die Ansicht ist, Zoom in drei Mal wiederholt in Zoom zu stoppen. wie kann ich es nur einmal machen
PS: android:repeatCount="1"
funktioniert nicht.
EDIT 1: meine Animation Util haben laden Animation als
Folowingpublic 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();
}
jetzt habe ich es wie folgt
zoomIn = loadAnimation(getContext(),
R.anim.zoom_in);
view.startAnimation(zoomIn);
Was ist, wenn Sie 'android nicht erwähnen: repeatCount = '" 1 "' – ELITE
versuchen Sie auch 'AnimationListener' im Code und stoppen Sie die Animation in' onAnimationEnd 'Methode. – ELITE
Wenn ich Wiederholungszählung nicht erwähne, zoomt es dreimal. und wenn ich wiederholen zähle es auch 3 mal wiederholen. – MKY