Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    That is not a good idea. This solution might only work for a single-line text. If there are multiple lines, you have to calculate which text goes into which line and add a space in front (plus if the current line's content gets to the next line after spacing, or if a word is too long for a single line). Additionally, one space might not be enough. So this only works in a very specific case.
    – andras
    Commented Mar 4, 2019 at 8:23
  • 1
    Another solution is to increase the textbox width by a few dps and place the text in the center. This can be done in the activity Java file.
    – idk
    Commented Mar 5, 2019 at 9:31
  • This hint was useful for my case. I needed to output 1-3 symbols and they were clipped from the sides. I didn't wanted to do anything complicated and universal with overriding classes. Adding spaces resolved my problem.
    – mspnr
    Commented Mar 30, 2021 at 16:11