4

我使用了“maxlines”设置为 1 的 Edittext。当我输入一些大文本时,文本的某些部分不可见。所以我使用光标指针(单击edittext时出现的蓝色)滚动文本。但是当我尝试使用它时,它超出了视图而不是显示隐藏的文本。

有什么我想念的吗?

4

3 回答 3

1

设置您的 Edittext 的以下属性,它将解决您的问题。

android:singleLine="true"
android:ellipsize="end"
于 2012-12-17T05:16:41.270 回答
0

http://developer.android.com/reference/android/widget/EditText.html声明如下

        android:maxLength   
        setFilters(InputFilter) 
        Set an input filter to constrain the text length to the specified number. 

您可以使用它来指定 EditText 输入的长度

或者您希望文本比视图更宽,那么您可以使用

        android:scrollHorizontally  
        setHorizontallyScrolling(boolean)   
        Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). 
于 2012-12-17T05:11:45.417 回答
0

不知道你的意思,我的回答是基于我对你的问题的理解:

尝试在您的 XML 中使用以下代码行:

    android:paddingRight="08dp" 
    android:paddingLeft="08dp" 
于 2012-12-17T05:17:47.123 回答