You can look at TextView source here, perhaps copy some code, or get
some ideas:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/TextView.java;h=64c9c9964d167532097964937dc9056d70ad0995;hb=froyo
(this is for Froyo)
But I'm wondering what you are actually trying to do with this. Can you
elaborate?
-- Kostya
14.12.2010 16:43, HippoMan пишет:
In a different thread, I asked if there was a way to query some object
to define what subset of a long piece of text is actually being shown
within a given TextView.
Based on the scant feedback I received in response to this query, I
have come to the conclusion that android probably does not provide any
programmatic way to ask a TextView or one of its subsidary objects
what subset of text is actually being displayed in the visible area of
this view.
So now, I'd like to approach this problem from a different direction:
If I have a large piece of text (where "large" means that there is
more text that can fit into the visible portion of a given TextView),
how can I determine *in advance* which subset of the text will fit
into the current visible screen area?
I know that I can calculate this by taking the text view dimensions,
its border and spacing characteristics, its font size, and other info
into account. I also have to figure out how the text will be word-
wrapped when writing it into the TextView.
Of course, this can all be calculated, but I'm wondering if there
already is a pre-existing method I can call (or a small number of pre-
existing methods) which can tell me how much of a given piece of text
will actually fit into the view?
I do not want to reverse engineer existing android objects and "re-
invent the wheel" if there already is a straightforward way to get
this information from existing objects.
Thanks in advance for any pointers you could give me.
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en