Monday, 20 August 2012

Get number of lines of TextView in android

How to get total number of lines of TextView ? TextView textView = (TextView)findViewById(R.id.textView1); int totalLines = textView.getLineCount(); ViewTreeObserver vto = this.textView.getViewTreeObserver();        vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {            @Override            public void onGlobalLayout() {                ViewTreeObserver obs = textView.getViewTreeObserver();                obs.removeGlobalOnLayoutListener(this);                System.out.println(":...

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Review