Forum Archive

vertically center text in ui.textview?

roosterboy197

We can set horizontal alignment in a textview, but what about vertical centering? Is there a way to accomplish that? I tried using ui.CONTENT_CENTER but that doesn't seem to do anything for textviews.

omz

No, you can't change the vertical alignment of a TextView. If you only need one line, consider using a TextField; if it doesn't need to be editable, you can use a Label – both of these are vertically centered.

roosterboy197

Ah, okay, thanks. I think I can get by with a Label instead.