2014-10-28 5 views
1

EditText 필드가있는 팝업 레이아웃 인플레이터가 있습니다. 버튼을 누르면 내 활동 내에서 열립니다. 그런 다음 팝업 창을 통해 입력 정보를 요청합니다. EditText 필드 중 하나를 누르면 키보드가 표시되지 않습니다. 팝업보기가 상호 작용을 지원하지 않습니까?안드로이드 팝업보기에 키보드가 표시되지 않습니다.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" 
android:background="@android:color/background_light"> 
<LinearLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" 
android:layout_margin="1dp" 
android:background="@android:color/darker_gray"> 
> 
<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    > 
    <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="Fill in the information." /> 

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

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 

      android:text="Field ID or Name" 
      android:textAppearance="?android:attr/textAppearanceMedium" /> 

     <EditText 
      android:id="@+id/fieldname" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:layout_below="@+id/textView1" 
      android:ems="10" > 

      <requestFocus /> 
     </EditText> 

     <TextView 
      android:id="@+id/enterWidth" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Width of Implement - Feet or Meters" 
      android:layout_below="@+id/fieldname" 
      android:textAppearance="?android:attr/textAppearanceMedium" /> 



     <EditText 
      android:id="@+id/width" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:ems="10" 
      android:layout_below="@+id/enterWidth" 

      android:inputType="numberDecimal" /> 

      <TextView 
      android:id="@+id/units" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Units" 
      android:layout_below="@+id/width" 
      android:textAppearance="?android:attr/textAppearanceMedium" /> 




     <RadioGroup 
      android:id="@+id/radiogroup" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_below="@+id/units" 
android:orientation="vertical"> 
<RadioButton android:id="@+id/standard" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Standard - feet, ac, mph" 
    android:onClick="onRadioButtonClicked"/> 
<RadioButton android:id="@+id/metric" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Metric - m, ha, kph" 
    android:onClick="onRadioButtonClicked"/> 
</RadioGroup> 


     <TextView 
      android:id="@+id/comments" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Field Comments" 
      android:layout_below="@+id/radiogroup" 
      android:textAppearance="?android:attr/textAppearanceMedium" /> 


      <EditText 
     android:id="@+id/commentlines" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/comments" 
     android:ems="10" 
     android:inputType="textMultiLine" /> 

    </RelativeLayout> 



    <Button 
     android:id="@+id/startbutton" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="Begin Spraying" /> 
    </LinearLayout> 
    </LinearLayout> 

답변

1

파고 후 나는이 유사한 게시물을 발견 :

EditText On A Popup Window

키가 PopupWindow가 포커스를 확인하는 것입니다

여기 내 XML이다.

popupWindow.setFocusable(true); 
:

이는하여 수행 할 수 있습니다

관련 문제