2012-11-29 2 views
1

내 레이아웃을 이동하려고합니다. 사용자가 텍스트 편집을 터치 할 때키보드를 열고 내 레이아웃 위젯이 올라갑니다. 난 매니페스트 안드로이드 코드를 사용했다 : windowSoftInputMode는 = "adjustPan는" 다음 안드로이드 : windowSoftInputMode = "adjustPan | adjustResize는" 아무것도 일이 이렇게 저를 도와주세요
여기에 넣고 내 XML소프트 키보드가 안드로이드에서 열려있을 때 전체 레이아웃 이동 방법

<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/theme_color" 
     android:orientation="vertical" > 

     <RelativeLayout 
      android:id="@+id/relativeLAyoutId" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_centerVertical="true" 
      android:focusable="true" 
      android:focusableInTouchMode="true" > 

      <ImageView 
       android:id="@+id/imageView1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentTop="true" 
       android:layout_centerHorizontal="true" 
       android:src="@drawable/osmosis_label" /> 

      <EditText 
       android:id="@+id/login_screen_username_editText1" 
       android:layout_width="220dp" 
       android:layout_height="40dp" 
       android:layout_below="@+id/imageView1" 
       android:layout_centerHorizontal="true" 
       android:layout_marginTop="15dp" 
       android:ellipsize="start" 
       android:ems="10" 
       android:gravity="left" 
       android:hint="@string/username_editbox_text" 
       android:imeOptions="actionNext" 
       android:singleLine="true" > 

       <requestFocus /> 
      </EditText> 

      <EditText 
       android:id="@+id/login_screen_password_editText2" 
       android:layout_width="220dp" 
       android:layout_height="40dp" 
       android:layout_alignLeft="@+id/login_screen_username_editText1" 
       android:layout_below="@+id/login_screen_username_editText1" 
       android:layout_marginTop="15dp" 
       android:ellipsize="start" 
       android:ems="10" 
       android:gravity="left" 
       android:hint="@string/password_editbox_text" 
       android:imeOptions="actionDone" 
       android:inputType="textPassword" 
       android:textColor="@color/login_layout" > 
      </EditText> 

      <ImageView 
       android:id="@+id/login_screen_submit_button1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/login_screen_password_editText2" 
       android:layout_centerHorizontal="true" 
       android:layout_marginTop="15dp" 
       android:src="@drawable/log_in" 
       android:text="Login" /> 

      <TextView 
       android:id="@+id/textView1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/login_screen_submit_button1" 
       android:layout_centerHorizontal="true" 
       android:layout_marginTop="15dp" 
       android:text="@string/registered_textview_id" 
       android:textColor="@color/grey_color" 
       android:textSize="18sp" 
       android:textStyle="bold" /> 
     </RelativeLayout> 

    </RelativeLayout> 
+0

@ Ashutosh Bansaldid 해결책을 찾았습니까? 나는 같은 문제가있다. –

+0

이 링크는 도움이 될 수 있습니다. [http://stackoverflow.com/questions/7300497/adjust-layout-when-soft-keyboard-is-on][1] 가 허용 원치 참조 [1] : http://stackoverflow.com/questions/7300497/adjust-layout-when-soft-keyboard-is-on –

답변

0

당신의 만들다.

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE|WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); 
관련 문제