简体   繁体   English

当我停止时,TextView滚动突然停止。 如何使它继续运转并缓慢停止?

[英]TextView scrolling stops abruptly when I stop. How can I make it keep going and slow to a stop?

TextView scrolling stops abruptly when I stop. 当我停止时,TextView滚动突然停止。 How can I make it keep going and slow to a stop, like most real apps. 像大多数真正的应用程序一样,我如何才能使其持续运转并缓慢停止。

This is the code I added: 这是我添加的代码:

        String s = readTextFile(inputStream);
        TextView tv = (TextView) findViewById(R.id.textView1);
        tv.setMovementMethod(new ScrollingMovementMethod());
        tv.setText(s);

And in the XML: 在XML中:

android:scrollbars = "vertical"

Turns out I needed "ScrollView". 原来我需要“ ScrollView”。 Simple answer. 简单的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM