本文介绍了如何使Android中的edittext可滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我正在创建一个包含编辑文本的动态布局.我想让这个编辑文本可滚动.
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
这篇关于如何使Android中的edittext可滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)