Android的 - 关于web视图编辑文字问题 [英] Android - Questions about Edit Text in WebView
问题描述
我使用的是编辑文本放在一个网址,在网上进行搜索。但要使用URL,我需要把HTTP:// URL中的前面。有没有一种方法,来掩饰这一点,并使用它的默认?
和另一件事是在编辑文本只有一个单行?
感谢
有没有一种方法,来掩饰这一点,并使用它的默认?
在检索来自的EditText
,看到的价值,如果它有一个公认的计划开始(例如,的https://
)。如果没有,你自己添加它,通过字符串连接或的StringBuilder
什么的。
和另一件事是在编辑文本只有一个单行?
使用安卓MAXLINES =1
在<的EditText>
在布局元素
I'm using a Edit Text to put in a URL to search in the Internet. But to use a URL, I need to put http:// in front of the Url. Is there a way, to hide this and use it for default?
And the other thing is to have only one single line in the Edit Text?
Thanks
Is there a way, to hide this and use it for default?
When you retrieve the value from the EditText
, see if it begins with a recognized scheme (e.g., https://
). If not, add it yourself, through string concatenation or StringBuilder
or something.
And the other thing is to have only one single line in the Edit Text?
Use android:maxLines="1"
in the <EditText>
element in your layout.
这篇关于Android的 - 关于web视图编辑文字问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!