2014-04-07 15 views
1

지금 Android 앱을 만들려고합니다. 지금 나는 EditTexts를 만지작 거리며, EditText를 클릭하면 키보드 아래로 떨어집니다. 키보드를 클릭하면 EditText가 표시되고 버튼이 키보드를 방해하는 영역 아래로 드롭됩니다.클릭하면 EditText가 키보드 아래에 숨김

가 여기 내 레이아웃입니다 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center_horizontal" 
    android:orientation="vertical" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="me.flipbook.android.LoginActivity" > 

    <!-- Login progress --> 

    <ProgressBar 
     android:id="@+id/login_progress" 
     style="?android:attr/progressBarStyleLarge" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="8dp" 
     android:visibility="gone" /> 

    <TextView 
     android:id="@+id/flipbookText" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" 
     android:layout_marginBottom="36dp" 
     android:drawableLeft="@drawable/flipbook_logo" 
     android:drawablePadding="16dp" 
     android:fitsSystemWindows="true" 
     android:text="Flipbook" 
     android:textAppearance="?android:attr/textAppearanceLarge" 
     android:textColor="#FFFFFF" 
     android:textSize="48dp" 
     android:textStyle="bold" /> 

    <ScrollView 
     android:id="@+id/login_form" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 

     <LinearLayout 
      android:id="@+id/email_login_form" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" > 

      <AutoCompleteTextView 
       android:id="@+id/email" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="@string/prompt_email" 
       android:inputType="textEmailAddress" 
       android:maxLines="1" 
       android:singleLine="true" /> 

      <EditText 
       android:id="@+id/password" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="8dp" 
       android:hint="@string/prompt_password" 
       android:imeActionId="@+id/login" 
       android:imeActionLabel="@string/action_sign_in_short" 
       android:imeOptions="actionUnspecified" 
       android:inputType="textPassword" 
       android:maxLines="1" 
       android:singleLine="true" /> 

      <Button 
       android:id="@+id/email_sign_in_button" 
       style="?android:textAppearanceSmall" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="16dp" 
       android:text="@string/action_sign_in" 
       android:textColor="#f70" 
       android:textStyle="bold" /> 
     </LinearLayout> 
    </ScrollView> 

</LinearLayout> 

BeforeAfter

+1

사실 ScrollView에있는 것과 관련이있을 수 있습니다. 하나의 LinearLayout에 모든 것을 넣으려고 했습니까? – zgc7009

+0

@ zgc7009 시도했지만 아무 것도하지 않았습니다 – beechboy2000

+2

유용한 정보가 여기에 있습니다. http://stackoverflow.com/questions/4432903/softkeyboard-hiding-edittext –

답변

1

here 언급 한 바와 같이 adjustPan-<activity android:windowSoftInputMode="adjustResize"/> 을 변경하여, 나는 내 문제를 해결할 수 있었다.

관련 문제