Karakuri
Karakuri

Reputation: 38595

EditText cursor overlapping last letter

On one of the devices I use for testing (HTC One S, in case it matters), the EditText cursor will overlap the last letter instead of being positioned just after the letter. In the attached screenshot, the black line is the actual cursor and the red line is where the cursor should be. This only happens when the cursor is at the last position; in other positions it appears correctly between letters (or before the first letter if at the very beginning).

enter image description here

I don't even begin to know what might be the problem here. Does anyone have an idea?

Upvotes: 0

Views: 668

Answers (1)

Karakuri
Karakuri

Reputation: 38595

I solved this by doing the following:

int flags = editText.getPaintFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG;
editText.setPaintFlags(flags);

Upvotes: 1

Related Questions