textview 滑动条一直显示,

<TextView 
    android:id="@+id/textview" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:singleLine="false" 
    android:maxLines="5" 
    android:scrollbars="vertical" 
    />
TextView textView = (TextView)findViewById(R.id.text_view);  
textView.setMovementMethod(ScrollingMovementMethod.getInstance());
textView.setScrollbarFadingEnabled(false);

textview 换行

android:singleLine="false"
android:text="123\n321"

参考:

https://blog.csdn.net/zhangjikuan/article/details/25139789
https://blog.csdn.net/lplj717/article/details/71192024
https://blog.csdn.net/weixin_39646628/article/details/111509646#:~:text=textView%E5%A6%82%E6%9E%9C%E6%83%B3%E8%A6%81%E5%BC%BA%E5%88%B6%E6%8D%A2%E8%A1%8C%E7%9A%84%E8%AF%9D%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%85%88%E6%8A%8ATextView%E6%98%BE%E7%A4%BA%E6%96%B9%E5%BC%8F%E4%BF%AE%E6%94%B9%E4%B8%BA%E5%A4%9A%E8%A1%8C%28android%3AsingleLine%3D%22false%22%29%EF%BC%8C%E7%84%B6%E5%90%8E%E6%89%8D%E8%83%BD%E6%8D%A2%E8%A1%8C%E3%80%82,%E6%96%B9%E6%B3%95%E4%B8%80%E8%88%AC%E7%94%A8%E4%B8%A4%E7%A7%8D%EF%BC%9A1%E3%80%81%E5%9C%A8%E5%AD%97%E7%AC%A6%E4%B8%B2%E9%87%8C%E5%8A%A0%E5%85%A5%E2%80%9Cn%E2%80%9D%EF%BC%8C%E5%A6%82%22abcnrc%22%3B2%E3%80%81%E6%8A%8ATextView%E8%AE%BE%E7%BD%AE%E4%B8%BA%E5%9B%BA%E5%AE%9A%E5%AE%BD%E5%BA%A6%EF%BC%8C%E7%84%B6%E5%90%8E%E8%AE%A9%E7%B3%BB%E7%BB%9F%E8%87%AA%E5%8A%A8%E6%8D%A2%E8%A1%8C%E3%80%82

标签: application

添加新评论