Friday, April 8, 2011

Detecting if particular string is currently visible on TextField()

I have a TextField() with a quite long text , sometimes last lines are not visible on screen (without scrolling).

Now I want to detect if e.g. word IBM is currently visible on screen, or is it outside of screen. Any ideas how to do this? I want to display this particular word IBM by scrolling myself the textField() to the right position.

From stackoverflow
  • Check the documentation of the getLineIndexOfChar() to determine the line which contains a given character, then compare the retreived value with scrollV and bottomScrollV to determine if the given line is visible or not.

0 comments:

Post a Comment