android - 在 EditText 中快速滚动

标签 android android-edittext fastscroll

我的 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/

相关文章:

Android 应用标签颜色

android - 如何在为 Android 中的 EditText 按下删除/后退按钮时快速删除文本?

java - 如何在没有第三库的情况下向 Recyclerview 添加快速滚动滚动条

android - Recyclerview 快速滚动项目消失

android - 了解 iphone 和 android 中的 HTML 字体大小差异

Android-MobileProfiles : How to change Profile to silent or ringer automatically, 关于移动位置的更改?

c# - 如何使用 Experitest 检查 Android( native )应用程序的密码字段的屏蔽? -

android - 立即验证检查 edittext 字段的输入(整数类型)

android - AccessibilityService 从 AlertDialog 更改 EditText