How to get total number of lines of TextView ?
Related links :
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(": " +
textView
.getLineCount());
}
});
Related links :
- Fore more IT-new updates
- New Mobile OS from Mozila Firefox
- Free Best android toturial
- Button demo tutorial in android download
- Android - IDE(AIDE) let you allow to develop android application without PC or eclipse.
- Android mobile hidden tricks and tips, android hidden codes
0 comments:
Post a Comment
Fill free to post your Queries and Suggesion...!