2014-12-15 3 views
1

안드로이드 및 그 레이아웃에 관한 새로운 소식입니다. Signup 화면을 디자인했지만 문제가 있습니다. 문제는 입니다. 데이터 입력을 시작하면 SIGNUP 버튼이 키보드로 움직이고 Password 필드를 덮습니다. 그 위치에 그대로 있어야합니다. 어떻게 해결할 수 있습니까? 내 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="@android:color/white" 
android:orientation="vertical" > 

<LinearLayout 
    android:id="@+id/headerLayout" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="40dp" 
    android:orientation="horizontal" > 

    <TextView 
     android:id="@+id/headerText" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="#ffffff" 
     android:text="SIGN UP" 
     android:textColor="#00aeef" 
     android:textSize="22dp" /> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_centerVertical="true" 
    android:orientation="vertical" > 

    <EditText 
     android:id="@+id/fname" 
     android:layout_width="fill_parent" 
     android:layout_height="50dp" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:layout_marginTop="5dp" 
     android:background="@drawable/edit_text_design" 
     android:ems="10" 
     android:hint="First Name" 
     android:inputType="textCapSentences"> 

     <requestFocus /> 
    </EditText> 

    <EditText 
     android:id="@+id/lname" 
     android:layout_width="fill_parent" 
     android:layout_height="50dp" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:layout_marginTop="10dp" 
     android:background="@drawable/edit_text_design" 
     android:ems="10" 
     android:hint="Last Name" 
     android:inputType="textCapSentences"/> 

    <EditText 
     android:id="@+id/eemail" 
     android:layout_width="fill_parent" 
     android:layout_height="50dp" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:layout_marginTop="10dp" 
     android:background="@drawable/edit_text_design" 
     android:ems="10" 
     android:hint="Email" 
     android:inputType="textEmailAddress" > 
    </EditText> 

    <EditText 
     android:id="@+id/pass" 
     android:layout_width="fill_parent" 
     android:layout_height="50dp" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:layout_marginTop="10dp" 
     android:background="@drawable/edit_text_design" 
     android:ems="10" 
     android:hint="Password" 
     android:inputType="textPassword" /> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_marginBottom="20dp" 
    android:layout_alignParentBottom="true"> 

    <Button 
     android:id="@+id/signupBtn" 
     android:layout_width="150dp" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" 
     android:layout_marginTop="10dp" 
     android:background="#ffffff" 
     android:text="SIGN UP" 
     android:textColor="#00aeef" 
     android:textSize="36dp" /> 
</LinearLayout> 

</RelativeLayout> 

답변

2

매니페스트의 활동의 android:windowSoftInputMode="adjustNothing"을 변경해보십시오 감사합니다.

예 :

<activity 
    android:windowSoftInputMode="adjustNothing" 
    android:name=".SongPlayActivity" 
    android:label="@string/title_activity_song_play" > 
</activity> 

그리고이없는 작품의 경우

다음 windowSoftInputMode에 대해 다른 값을 시도해보십시오.

관련 문제