2013-08-21 3 views
2

내 앱에 EditText이 있는데 키를 입력하는 대신 ime 버튼을 표시하고 다음 줄에 너무 긴 텍스트 (SMS 앱과 같이)를 이동하려면 두 줄로 표시하고 싶습니다. 지금 나는이 같은 있습니다EditText 다음 줄로 긴 텍스트 이동

<AutoCompleteTextView 
    android:id="@+id/name_field" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:layout_marginLeft="10dp" 
    android:layout_weight="1" 
    android:background="@null" 
    android:freezesText="true" 
    android:hint="@string/some_hint" 
    android:imeOptions="actionNext" 
    android:maxLength="100" 
    android:nextFocusDown="@null" 
    android:lines="2" 
    android:ellipsize="end" 
    android:inputType="textImeMultiLine" 
    android:selectAllOnFocus="true" 
    android:textColor="@android:color/black" 
    android:textSize="16sp" /> 

그것은 내가 언급이 개 첫번째 특성을 가지고,하지만 난 내가 세 번째 도달 할 수있는 옵션을 불러올 수 없습니다. 예를 들어

: 내 EditText에서 한 행 10 개 문자가있는 경우, 그와 같은 텍스트 "ABC ABCDEFGHIJK ABC의 ABCD"를 표시하려면 :

abc abcd 
abc abc... 

편집 : 문제가 android:inputType="textImeMultiLine"에 보인다. 내가 그것을 android:inputType="textMultiLine"으로 바꿨을 때, 모든 것이 잘 작동하지만 ... 나는 IME 버튼 대신에 버튼을 입력했다. 나는 피하고 싶다.

+0

당신은 ... 당신이 정확하게 원하는 것을 더 명확하게 할 수 – Hariharan

+0

텍스트 (때문에 한 줄에 표시 할 수없는 경우 텍스트가 너무 깁니다.), 나머지 부분을 두 번째 줄에 표시하고 싶습니다. – Seblis

+0

'android : lines'은 .. – CRUSADER

답변

0

대신 XML android:maxLines="2"이 추가!

<AutoCompleteTextView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:layout_marginLeft="10dp" 
    android:background="@null" 
    android:freezesText="true" 
    android:imeOptions="actionNext" 
    android:maxLength="100" 
    android:nextFocusDown="@null" 
    android:lines="2" 
    android:ellipsize="end" 
    android:selectAllOnFocus="true" 
    android:textColor="@android:color/black" 
    android:textSize="16sp" /> 
+0

원본과이 차이점은 무엇입니까? – ArieDov

+0

아마도'android : inputType'의 부족한 부분일까요? – kassim

0

는 작동 this..Hope 시도 android:lines="2"

+0

나는 이미 그것을 시도했지만, 그것은 나를 위해 작동하지 않았다. – Seblis

0

이 줄을 추가

안드로이드 : inputType = "textMultiLine"

관련 문제