如何使EditText上Android中滚动? [英] How to make edittext in Android scrollable?

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

问题描述

我创建一个动态的布局包含一个编辑文本。我想使这个编辑文本滚动。

  questionEntry.setMaxLines(1);
questionEntry.setVerticalScrollBarEnabled(真正的);
questionEntry.setMovementMethod(新ScrollingMovementMethod());
 

使用这个code我做我的编辑文本滚动。但问题是,当我打字的东西。如果达到了编辑文本的末尾,它会停止键入我的文字,而不是自动跳转到下一行。如果我preSS回车键时,它会跳。我想让它自动的。

解决方案

  questionEntry.setScroller(新滚轮(myContext));
questionEntry.setMaxLines(1);
questionEntry.setVerticalScrollBarEnabled(真正的);
questionEntry.setMovementMethod(新ScrollingMovementMethod());
 

我做了一些变化,我的previous code。
张贴以上是我的新code。

这s工作......感谢所有

I am creating a dynamic layout that contains an edit text. I want to make this edit text scrollable.

questionEntry.setMaxLines(1);
questionEntry.setVerticalScrollBarEnabled(true);
questionEntry.setMovementMethod(new ScrollingMovementMethod());

Using this code I made my edit text scrollable. But the problem is when I am typing something. If it reaches the end of the edit text, it will stop typing my text and not automatically jump to the next line. If I press the enter key, it will jump. I want to make it automatic.

解决方案

questionEntry.setScroller(new Scroller(myContext)); 
questionEntry.setMaxLines(1); 
questionEntry.setVerticalScrollBarEnabled(true); 
questionEntry.setMovementMethod(new ScrollingMovementMethod()); 

i made some changes in my previous code.
above posted is my new code.

it s working...thanks for all

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

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