I did like below in xml
xml
I like neither of the answers. Simply set the inputType and the TextView will adapt to its content
Tested on a Nexus One (2.3) and Nexus 4 (4.4)