android - How to get text's coordinate inside a TextView? -


i have situation:there 2 textviews, one's gravity left|centervertical , other's right|centervertical. when wraping them, texts must wrap positions exactly, left left ,right right. achive this, have coordinate of text inside textview, can calculate offset, how text's coordinate inside textview without inner padding?

i think there no solution text's coordinate inside textview without inner padding value.

if want text's coordinate, should calculate using view's location , inner padding value.

public float gettextpositionx(textview textview) {     return textview.getx() + textview.getpaddingleft(); }  public float gettextpositiony(textview textview) {     return textview.gety() + textview.getpaddingtop(); } 

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -