【问题标题】:scrollbars="vertical" is not working in TextView [duplicate]滚动条 =“垂直”在 TextView 中不起作用 [重复]
【发布时间】:2019-06-30 15:02:24
【问题描述】:

如下图所示,滚动条显示但不工作或滚动

XML:

<TextView
    android:id="@+id/text_view_dialog_notes"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="7dp"
    android:layout_marginRight="7dp"
    android:hint="@string/rv_notes_content"
    android:padding="5dp"
    android:scrollbars="vertical"
    android:minLines="10"
    android:maxLines="10"
    android:textSize="17sp" />

哪里出了问题以及如何解决?

【问题讨论】:

    标签: android textview scrollbar


    【解决方案1】:

    确保将其添加到代码中:

    yourTextView.setMovementMethod(new ScrollingMovementMethod());
    

    【讨论】:

      【解决方案2】:

      在 textView 上使用滚动条

      你必须在java中添加这一行

      textView.setMovementMethod(new ScrollingMovementMethod());
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-09-04
        • 1970-01-01
        • 2013-07-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多