how to use getlinecount() in textview android

前端 未结 6 1767
忘掉有多难
忘掉有多难 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:45

    Please check this link.

    Android Edittext: Get LineCount in an Activity's onCreate()

    tv.getLineCount(), will always retirn 0, if internal layout is not created yet.

提交回复
热议问题