Android development: improving EditText scroll?

Is there a way to increase my scroll of an EditText? I want it to scroll, as in a web browser, smoothly and quickly. Is it possible?

Thanks, Alex.

+8
android android-edittext scroll
source share
3 answers

Webview uses smooth scrolling. This property also has a scroll view.

  • Add a text view inside the scroll.
  • Make an id for scrolling and create a link in your code.
  • Put EditText in this scroll (do editText for Wrap Content).

Enable smooth scrolling using the method below.

public void setSmoothScrollingEnabled(boolean smoothScrollingEnabled) 

Control smooth scrolling by specifying the borders to scroll using the method below ...

 public final void smoothScrollBy (int dx, int dy) //dx,dy.. offset (Relative Position) public final void smoothScrollTo (int x, int y) //scroll to x and y (actual position) 

You can also simulate the scroll behavior using the following method,

 public void setOverScrollMode (int mode) 

You can also add Fling Action using the following method, ..

 public void fling (int velocityY) 
+16
source share

A better description of the current and desired behavior would be good, however you could get the desired behavior by embedding it in a ScrollView.

+1
source share

You can create a CustomEditText extends EditText class and override the onTouch and onTouchEvent and use them to detect gestures, and then move the content up or down.

0
source share

Source: https://habr.com/ru/post/649831/


All Articles