Jump to content

Probleme avec EditText apres une animation


billahi

Recommended Posts

Bonjour,

J'ai un EditText qui lance une animation. Cette animation est une simple translation.

Le problème est qu'après l'animation, quand on écrit du texte,il n'apparait pas dans le nouveau emplacement de l'EditText.

Il apparait à moitié voir pas de tout. C'est comme si l'emplacement où le texte doit apparaitre n'a pas subi la translation.

Voir le code simple:

TranslateAnimation tr = new
TranslateAnimation(0, 0, 0,100);
tr.setStartOffset(0);
tr.setDuration(1000); 
tr.setFillAfter(true);
myEditText.startAnimation(tr);

Et voila le layout:

 android:id="@+id/ecrire"
android:layout_width="170dp"
android:layout_height="60dp"
android:layout_marginTop="70dp"
android:layout_marginLeft="10dp"
android:background="#B6AFB2"
android:hint="Toto"
android:inputType="textMultiLine"
android:nextFocusDown="@+id/foe"
android:imeOptions="actionNext"
android:maxLength="300"
android:gravity="top"/>

L'EditText a été bien déplacé pourtant.

Merci d'avance.

Link to comment
Share on other sites

  • 2 weeks later...
Bonjour,

J'ai un EditText qui lance une animation. Cette animation est une simple translation.

Le problème est qu'après l'animation, quand on écrit du texte,il n'apparait pas dans le nouveau emplacement de l'EditText.

Il apparait à moitié voir pas de tout. C'est comme si l'emplacement où le texte doit apparaitre n'a pas subi la translation.

Voir le code simple:

TranslateAnimation tr = new
TranslateAnimation(0, 0, 0,100);
tr.setStartOffset(0);
tr.setDuration(1000); 
tr.setFillAfter(true);
myEditText.startAnimation(tr);

Et voila le layout:

 android:id="@+id/ecrire"
android:layout_width="170dp"
android:layout_height="60dp"
android:layout_marginTop="70dp"
android:layout_marginLeft="10dp"
android:background="#B6AFB2"
android:hint="Toto"
android:inputType="textMultiLine"
android:nextFocusDown="@+id/foe"
android:imeOptions="actionNext"
android:maxLength="300"
android:gravity="top"/>

L'EditText a été bien déplacé pourtant.

Merci d'avance.

Remplace le setFillAfter(true) par setFillAfter(false) et test pour voir.

Link to comment
Share on other sites

  • 10 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...