billahi Posted April 15, 2010 Share Posted April 15, 2010 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 More sharing options...
arnouf Posted April 25, 2010 Share Posted April 25, 2010 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 More sharing options...
hocinao Posted March 18, 2011 Share Posted March 18, 2011 setFillEnabled(true) ; ;) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.