TextView
은 5 행 이상인 경우 스크롤 할 수있게 만들었습니다. 이제 동적으로 내 Java 코드에서 동일한 TextView
이 스크롤 할 수 있는지 또는 스크롤하여 스크롤 할 수 있는지 확인합니다. 스크롤 할 수 있으면 스크롤 할 수 있으므로보기 아래에보기를 변경할 수 있습니다. TextView를 스크롤 할 수 있는지 확인하는 방법
textView.setText(description);
textView.setMovementMethod(new ScrollingMovementMethod());
if(textView.getLineCount() > 5)
{
view.setVisibility(View.VISIBLE);
}
하지만 textView.getLineCount()
또한 기능 canScrollHorizontally(int direction)
을 시도했지만 구글의 문서는 내가 사용해야하는 매개 변수 말을하지 않는 0
과 같다.
는 http://stackoverflow.com/a/12037459/2649012 –
내가 텍스트 후 getLineCount()를 호출하고있어 – tvieira
를 렌더링 http://stackoverflow.com/questions/3528790/textview-getlinecount-always-0-in-android 이것이 도움이 될 수도 있습니다 – enadun