I’m currently using setGravity(Gravity.CENTER_VERTICAL) and this works well when the TextView is tall enough. However, if the TextView is narrow, then only the bottom of the text is clipped; I want the text to be clipped equally from above and below.
I’m currently using setGravity(Gravity.CENTER_VERTICAL) and this works well when the TextView is tall enough.
Share
I found the solution,
if height of view is not enough, you must move scroll value. you can call this function in onlayout function,