用的EditText在单行长期默认的文本 [英] EditText with long default text on a single line
本文介绍了用的EditText在单行长期默认的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个的EditText
,我试图用一个很长的,unbreaking文本值(URL)来设置,但即使有下面的XML声明,文本突破到第二行。
I have an EditText
that I am trying to set with a very long, unbreaking text value (a URL), but even with the following XML declaration, the text is breaking to a second line.
<EditText
android:id="@+id/address"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:maxLines="1"
android:hint="Enter URL"
android:text="http://www.example.com/news/2010-07-15/this-is-the-story-title-here.html">
</EditText>
我在这里试图解决方案(添加的android:ellipsize =结束
),但它并没有区别。减少文本长度的东西不超过的EditText
工作......但是这是现实的网址的EditText $ C的长度更$ C>。
I've tried the solutions here (adding android:ellipsize="end"
), but it made no difference. Reducing the text in length to something no more than the length of the EditText
worked... but this is realistic for a URL EditText
.
有什么建议?
谢谢,
保
推荐答案
设置
android:scrollHorizontally="true"
这篇关于用的EditText在单行长期默认的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文