I want to change text size of EditText
as text entered. It means initially text is large but when user enters text (increase length of text) then the size of text should be decreased gradually.
Is there any inbuilt style or theme for EditText
widget which automatically adjust text size in EditText
?

- 53,910
- 52
- 193
- 240

- 1,603
- 3
- 27
- 45
-
I don't know about you, but for me an app with such a feature would be annoying/confusing to use. Don't surprise the user. – Gabriel Negut Jun 13 '11 at 06:43
2 Answers
I guess you can try this method: setTextAppearance(Context context, int resid)
The method helps you to Set the text color, size, style, hint color, and highlight color from the specified TextAppearance
resource.
(or)
setTextSize(float size)
Set the default text size to the given value, interpreted as "scaled pixel" units.
(or)
setTextSize(int unit, float size)
Set the default text size to a given unit and value.

- 15,249
- 7
- 52
- 81

- 3,903
- 6
- 31
- 57
You could apply a span to your text which you update each time the text changes. A TextAppearanceSpan will allow you to change the text size.
I would, however, echo Gabriel Negut's comment. What you're trying to do is something which is standard on iOS, but will be alien to your Android users. Your app should always behave in a way that is consistent with what they are used to elsewhere in to OS and trying to make your app behave like an iOS app will only confuse your users.

- 21,839
- 8
- 47
- 46