Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
@Rob, if the width and height are wrap_content, then technically, the text is already centered.
I'm assuming you're using XML layout.
If I want to align TextView relative to another view, but it's text centered in itself?
Not to be confused with android:layout_gravity="center", which does something else.
This doesn't work when used with a RelativeLayout where the layout's height & width are set to wrap_content