je crée une application dans laquelle edittext ajoute durée de style à certaines positions de texteComment modifier automatiquement la position de l'étendue, si du texte a été ajouté avant le texte étendu dans EditText?
editable.setSpan(new StyleSpan(Typeface.BOLD), start, start+replacement.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
Mon problème est que si ajoute l'utilisateur, un texte ou un espace blanc avant sera retiré le style de texte enjambée, comment éviter cela?
int SPAN_COMPOSING = 256;
int SPAN_EXCLUSIVE_EXCLUSIVE = 33;
int SPAN_EXCLUSIVE_INCLUSIVE = 34;
int SPAN_INCLUSIVE_EXCLUSIVE = 17;
int SPAN_INCLUSIVE_INCLUSIVE = 18;
int SPAN_INTERMEDIATE = 512;
int SPAN_MARK_MARK = 17;
int SPAN_MARK_POINT = 18;
int SPAN_PARAGRAPH = 51;
int SPAN_POINT_MARK = 33;
int SPAN_POINT_MARK_MASK = 51;
int SPAN_POINT_POINT = 34;
int SPAN_PRIORITY = 16711680;
int SPAN_PRIORITY_SHIFT = 16;
int SPAN_USER = -16777216;
int SPAN_USER_SHIFT = 24;
De quel type aurai-je besoin dans mon cas?
Utilisez TextWatcher. Vous recevrez un rappel pour chaque fois que votre texte a changé. utilisez setSpan ici. – Imdad
pouvez-vous relire ma question? –