2012-07-18 5 views
4

아래에 여러 줄 EditText 및 제출 버튼이 있습니다.
사용자가 텍스트 편집 영역을 누르면 소프트 키보드가 나타납니다.
Enter 키가있어 사용자가 다음 줄로 이동할 수 있습니다.
내 문제는 소프트 키보드가 내 제출 버튼을 숨 깁니다 ( ). 사용자가 편집을 마쳤 으면 기기의 뒤로 버튼을 눌러 제출할 소프트 키보드를 숨겨야합니다.
키보드에서 입력 및 완료 버튼을 계속 유지할 수있는 방법이 있습니까? 아니면 더 좋은 해결책이 있습니까?Android 멀티 라인 EditText

미리 감사드립니다.

답변

0

그래 당신은 버튼을 페이지에 있지만 키보드의 상단에 하단에 항상 유지 레이아웃, 당신에게 수 당신은 또한 XML 레이아웃에 imeAction을 설정할 수 있습니다이

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 


     <Button 
      android:id="@+id/button_save" 
      android:layout_width="0dip" 
      android:layout_height="wrap_content" 
      android:enabled="false" 
      android:layout_alignParentBottom="true" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentRight="true" 
      android:text="@string/button_save" /> 


    <ScrollView 
     android:id="@+id/scroll_view" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_above="@+id/button_save" 
     android:fadeScrollbars="false" 
     > 

...all your stuff here 
</ScrollView> 

</RelativeLayout> 
0

같은 뭔가를 사용할 수 있습니다 editText에 해당 이벤트에 대한 리스너가있는 경우 소프트 키보드에서 직접 완료/다음/검색 호출을 호출하십시오.