4

「maxlines」が 1 に設定された Edittext を使用しました。大きなテキストを入力すると、テキストの特定の部分が表示されません。そこで、カーソル ポインター (edittext を 1 回タップすると表示される青色) を使用して、テキストをスクロールします。しかし、使用しようとすると、非表示のテキストを表示する代わりに、ビューを超えてしまいます。

足りないものはありますか?

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 に答える