2011-08-23 4 views
0

여기 간단한 레이아웃 XML을 작성했습니다. (하나의 listview와 edittext로)Android 소프트 키 보드 표시/숨기기 제어 문제

공통 setContentView (R.layout.main)를 사용하여이 xml을 활성화하면; 소프트 키보드는 항상 아래쪽에서 나타납니다. 그러나 xml에서 listview 항목을 제거하면 softkeyboard가 표시되지 않습니다.

나는 listview와 softkeyboard 사이의 관계를 잘 모른다.

나는이 사이트에서 비슷한 질문을 검색했으며 초점 제어를 사용하는 솔루션을 언급 한 일부 기사를 검색했습니다. 하지만 내 xml 소프트 키보드없이 edittext에서 기본 포커스가 있습니다.

누군가이 문제를 해결하는 방법에 대한 조언을 제공 할 수 있습니까? 매니페스트 파일에 활동이 속성을 추가

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="480px" 
    android:layout_height="762px" 
    android:layout_gravity="center" 
    android:background="@drawable/bg_blank" 
    > 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     > 

     <ListView 
      android:id="@+id/mylist" 
      android:layout_width="100px" 
      android:layout_height="200px" 
      android:layout_marginLeft="0px" 
      android:layout_marginTop="70px" 
      /> 

     <EditText 
      android:id="@+id/input1" 
      android:layout_width="200px" 
      android:layout_height="50px" 
      android:layout_marginLeft="64px" 
      android:layout_marginTop="400px"   
      /> 
    </RelativeLayout> 

</FrameLayout> 

답변

0

시도

<activity android:windowSoftInputMode="stateAlwaysHidden" android:name=".Demo"/> 
관련 문제