Android的发展:完善的EditText滚动? [英] Android Development: Improve EditText Scrolling?

查看:169
本文介绍了Android的发展:完善的EditText滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以增加我的EditText的滚动? 我想让它滚动像它在网络上浏览,流畅,快捷。 这可能吗?

Is there any way I can increase my EditText's scrolling? I want to make it scroll like it does on the web browse, smooth and fast. Is this possible?

谢谢, 亚历克斯。

推荐答案

web视图使用平滑滚动。滚动视图也有此特性。

Webview uses Smooth scrolling. A scroll view also have this property.

  • 添加文本视图内滚动视图。
  • 请为滚动视图的ID和创建你的code参考。
  • 将在EditText上在这个滚动视图(使EDITTEXT为Wrap内容)。

启用平滑滚动使用下面的方法,

Enable Smooth Scrolling using the below method,

public void setSmoothScrollingEnabled(boolean smoothScrollingEnabled)

通过指定边界滚动,使用下面的方法控制平滑滚动...

Control the smooth scrolling by specifying bounds for the scroll, using the below method...

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)

您也可以模仿使用以下方法overscroll行为,

You can also imitate the overscroll behavior using the following Method,

public void setOverScrollMode (int mode)

您也可以使用下面的方法添加一扔行动,..

Also you can add Fling Action using the following method,..

public void fling (int velocityY)

这篇关于Android的发展:完善的EditText滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆