让android的TextView可以滚动

2019-12-17  本文已影响0人  lucas777

事实上你不需要使用ScrollView
只要在你的布局的xml文件中设置你的TextView的属性:

android:maxLines = "AN_INTEGER"

android:scrollbars = "vertical"
Then use:
然后在你的代码中用:

yourTextView.setMovementMethod(new ScrollingMovementMethod())
它可以自由的滚动了。

https://ask.csdn.net/questions/107

上一篇 下一篇

猜你喜欢

热点阅读