how to use getlinecount() in textview android

前端 未结 6 1731
忘掉有多难
忘掉有多难 2021-01-12 02:03

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.

i use mytextview.getLineCount()

6条回答
  •  孤城傲影
    2021-01-12 02:33

    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.

提交回复
热议问题