2012-01-19 65 views
1

是否有設備特殊的限制(其他然後總遊離存儲器大小)的文本中滾動多行的EditText長度或行計數時機器人:最大長度和機器人:MAXLINES未設置?我有一個EditText:的Android的EditText無限文本長度

<EditText 
    android:editable="false" 
    android:id="@+id/sip_log_log" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight = "1" 
    android:text="" 
    android:gravity = "top" 
    android:textColor="#00FF00" 
    android:background="#000000" 
    android:scrollbars="vertical" 
    android:focusable="true" 
    /> 

,當我打電話

mEditText.setText("some very very loooong string...."); 

只顯示文本的第一部分。該問題是設備特定的。在HTC Sensation或模擬器中一切正常,但Samsung Galaxy S 2從未顯示超過20頁的文字。我能以某種方式修復它嗎?或者是否有另一種方式在其他標準視圖中使用滾動條顯示極長文本(SIP登錄到我們的SIP客戶端)?

感謝所有回覆。

回答

1

我已經測試過的WebView與長文,甚至效果很好,但我仍想知道爲什麼的EditText上三星Galaxy無法正常工作。

+0

如果你的文章是不是答案,而是問題,那麼你就應該修改,而不是代替張貼一個答案你原來的問題。 –

2

將android:maxLength =「99999999」添加到佈局文件可修復此問題!

1

我有同樣的問題,並在XML設置android:maxLength="999999沒有解決這個問題。但是編程設定長度的過濾工作,就像這樣:

EditText mPrimaryPhoneField = (EditText) findViewById(R.id.primary_phone); 
    InputFilter[] phoneFilterArray = new InputFilter[1]; 
    //This needs to be a large number to fix a bug on Samsung Galaxy tablet where it would have a default limitation on numeric fields if you had no length filter at all. 
    phoneFilterArray[0] = new InputFilter.LengthFilter(100); 
    mPrimaryPhoneField.setFilters(phoneFilterArray);