I am wondering if it is possible to adapt programatically the height of an editText (with multi-line enabled) according to the lines inserted in a editText-view?
Let's say I need to populate an editText-view with a certain amount of words which would span over 5 lines, then I'd like that the editText adopted its height to show these 5 lines. The same goes with 3 lines - compared to the previous example, the editText would decrease its height-size.
I had a look at "MeasureMultilineTextHeight" in the StringUtils-library but it seems it can only be used with labels.
Edit: it seems like "MeasureMultilineTextHeight" works with editText as well. Therefore, I can probably use it to obtain what I am looking for. However, if anyone wants to share some code, please do so
Any ideas?
Let's say I need to populate an editText-view with a certain amount of words which would span over 5 lines, then I'd like that the editText adopted its height to show these 5 lines. The same goes with 3 lines - compared to the previous example, the editText would decrease its height-size.
I had a look at "MeasureMultilineTextHeight" in the StringUtils-library but it seems it can only be used with labels.
Edit: it seems like "MeasureMultilineTextHeight" works with editText as well. Therefore, I can probably use it to obtain what I am looking for. However, if anyone wants to share some code, please do so
Any ideas?
Last edited: