2011-01-12 2 views
4

필자에게는 여러 EditText 컴포넌트가있는 액티비티가 있습니다.android. 액티비티 스타트 업시 자동 초점 텍스트 뷰

활동이 시작되면 EditText 중 첫 번째 포커스가 집중되고 키보드가 나타납니다. 이 '기능'을 피하고 싶습니다. (활동을 시작한 후에 팝업 키보드가 나타나지 않기를 바랄 것입니다.)

답변

4

다른 종류의 레이아웃이 작동하는 경우에는 사용할 수 없습니다. 속성을 android:focusable="true"android:focusableInTouchMode="true"으로 설정하십시오.

<!-- Dummy item to prevent AutoCompleteTextView from receiving focus --> 
<LinearLayout 
    android:focusable="true" android:focusableInTouchMode="true" 
    android:layout_width="0px" android:layout_height="0px"/> 

<!-- :nextFocusUp and :nextFocusLeft have been set to the id of this component 
    to prevent the dummy from receiving focus again --> 
<AutoCompleteTextView android:id="@+id/text" 
     android:layout_width="fill_parent" android:layout_height="wrap_content" 
     android:nextFocusUp="@+id/text" android:nextFocusLeft="@+id/text"/> 
+0

예. 그게 전부! 고마워요 :) – davs

1

를 추가해보십시오

안드로이드 : windowSoftInputMode = "adjustPan"매니페스트에서 활동 요소에

.