I did something like this within my code:
public void test(){
TextView tv = (TextView)findViewById(R.id.text_view);
tv.setText("blablabla");
int width = tv.getWidth();
int height = tv.getHeight();
}
When test() is called(I am sure it's not called in the view or its
parent's constructor), Both width and height is zero!!! How can get
the width and height? Because the text might be quite long and be
ellipsized by TextView so Paint.measureText() and Paint.getTextBound()
can't fulfill this need.
Anyone knows please help me. Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---