TextView设置可滚动的方式

2022-07-27 11:56:24

步骤
1

<TextView
            android:id="@+id/tv_result"
            android:text="@string/register_now"
            android:scrollbars="vertical"
            android:singleLine="false"
            android:maxLines="10"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

2代码中

 TextView  tvResult = (TextView) findViewById(R.id.tv_result);
 tvResult.setMovementMethod(ScrollingMovementMethod.getInstance());
  • 作者:az44yao
  • 原文链接:https://blog.csdn.net/az44yao/article/details/114664306
    更新时间:2022-07-27 11:56:24