2013-07-11 51 views
1

這是我的編輯文本的外觀。它橫跨我的文字,並添加單詞EditText延伸我的文本

enter image description here

之間不必要的空間,這是在strings.xml中的文本:

<string name="type_msg">Type your message...</string> 

,這是佈局XML代碼:

<EditText 
      android:id="@+id/chat_message" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_centerVertical="true" 
      android:clickable="false" 
      android:scrollbarStyle="outsideOverlay"     
      android:background="@drawable/chat_text_box_corners" 
      android:maxLines="4"  
      android:minLines="1" 
      android:scrollbars="vertical"         
      android:hint="@string/type_msg"    
      android:paddingTop="7dp" 
      android:paddingBottom="7dp" 
      android:paddingLeft="10dp" 
      android:paddingRight="10dp" 
      android:layout_marginTop="15dp" 
      android:layout_marginBottom="15dp" 
      android:layout_marginRight="7dp" 
      android:layout_marginLeft="7dp" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:textColor="@color/gray_text" 
      android:layout_toLeftOf="@id/send_message" 
      android:layout_toRightOf="@id/call_btn"    
      /> 

它與我輸入時的行爲相同:

enter image description here

+1

當u編輯的EditText是怎麼回事,可能是這樣的 – Senthil

+0

提示文本格式不,當你輸入一些文字要花空間,甚至? – Carbon

+0

我只是試過,它的一切正確的我,檢查一些東西,如果你把OnTextChnage聽衆 – dhams

回答