我的 EditText 有时可能有非常大的文本(> 1000 行),我希望能够快速到达开头或结尾,所以我认为快速滚动是解决方案,但它不适用于 EditText,也不适用于 ScrollView,仅适用于 ListView 。我发现一些编辑应用程序的 EditText 中确实有快速滚动条。他们是如何做到的呢?在父 ScrollView 上设置 smoothScrollEnabled
不起作用
最佳答案
通过引用this ,
您可以使用 ScrollView
并将 EditText
放入其中,并提及您需要快速/平滑滚动的位置。
scrollview = (ScrollView) findViewById(R.id.scroll_view) ;
scrollview.setSmoothScrollingEnabled ( true );
scrollview.smoothScrollBy (int dx, int dy); //dx,dy.. offset (Relative Position)
scrollview.smoothScrollTo (int x, int y); //scroll to x and y (actual position)
关于android - 在 EditText 中快速滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41656716/