Android: difference between setTextAlignment and setGravity
I'm working with EditText
and know it was setTextAlignment
n't implemented until API 17 , but I don't see any setTextAlignment
easier or better use than setGravity
. What should I use for what purpose, or does it not matter?
I find it setGravity
very easy to work and do what I want, so when should I NOT be using this?
thank
source to share
setTextAlignment
available from API level 17, you won't be able to use it until 17. But setGravity
, available at API level 1. You can use it anywhere.
setGravity
Sets the horizontal text alignment and vertical gravity to be used when the TextView has extra space outside of what is required for the text itself
source to share