如何使用getlinecount()中的TextView的Andr​​oid [英] how to use getlinecount() in textview android

查看:190
本文介绍了如何使用getlinecount()中的TextView的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在我的文本视图多少行。 我已经设置mytextview文本,那么我想它有多少行采取mytextview。

i want to know how many line in my text view. i already set mytextview text, then i want to get how many line it take in mytextview.

我使用mytextview.getLineCount(),但没有奏效。 它总是返回0。

i use mytextview.getLineCount() but it didn't work. it always return 0.

可有人helpme。

推荐答案

感谢所有。我解决它了。我使用的线程来获取linecount就这样

thanks for all. i solved it already. i use thread to get the linecount just like this

@Override
public void run() {
    // TODO Auto-generated method stub
    while(textView.getLineCount() == 0){

    }
    countLine = textView.getLineCount(); 

}

希望这会帮助,如果你有同样的问题。 最好的方面。

hope this will help if you have same problem. best regard.

这篇关于如何使用getlinecount()中的TextView的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆