I tried using textview.setTranslationY(float) to change the y-coordinate of the textview but it does not seem to work. textview.setTop() seems to do the same function but the documentation says this method is meant to be called by the layout system and should not generally be called otherwise, because the property may be changed at any time by the layout. I use textview.getTranslationY() to get the y-coordinate.
How can I set the y-coordinate of textview? If what I am doing above is wrong, kindly suggest an alternative way. Maybe there is another method to set y-coordinate which I have not found yet!
My situation: I have a textview whose height should change based on some value received. If I use textview.setHeight(int), the height increases from top to bottom. I want it to increase from bottom to top. So I change the y-coordinate of the textview every time I set it's height.