2016-09-02 13 views
1

私のアプリケーションにフッタがありますが、キーボードが出るたびにフッタが押し上げられるという問題があります。マニフェストファイルに"android:windowSoftInputMode="adjustPan"コードを追加しましたが、修正されていません。 以下は、キーボードが隠された通常のビューです。キーボードがフッタを押し上げる

This is the normal view with keyboard hidden

これが私の見解では、目に見えるキーボードでどのように見えるかです。フッターを押し上げるのではなく、フッタを覆うようにしたいと思います。 isScrollContainer =:以下

second

はscrollviewに以下の行を追加すると、問題を解決する可能性があります、

アンドロイド

<android.support.design.widget.CoordinatorLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/myCoordinatorLayout" 
    xmlns:android="http://schemas.android.com/apk/res/android"> 

    <RelativeLayout 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:id="@+id/icons_container" 
     tools:context=".app.LoginActivity"> 

     <android.support.v7.widget.Toolbar 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/colorPrimary" 
      android:id="@+id/toolBar"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:src="@drawable/loginbannerimage" 
       android:contentDescription="banner" 
       android:layout_gravity="center_horizontal"/> 

     </android.support.v7.widget.Toolbar> 


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

      <LinearLayout 

       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="vertical"> 

       <!-- Login progress --> 
       <include layout="@layout/custom_progress_bar"/> 

       <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        app:cardUseCompatPadding="true" 
        app:cardElevation="3dp" 
        xmlns:app="http://schemas.android.com/apk/res-auto" 
        app:cardBackgroundColor="@android:color/black" 
        android:layout_marginBottom="0dp"> 

        <LinearLayout 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:orientation="vertical"> 
         <LinearLayout 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:orientation="horizontal"> 

          <android.support.v7.widget.CardView 
           android:layout_width="match_parent" 
           android:layout_height="match_parent" 
           app:cardBackgroundColor="@color/toolBar" 
           app:cardCornerRadius="0dp"> 

           <TextView 
            android:layout_width="match_parent" 
            android:layout_height="wrap_content" 
            android:text="Welcome To MAP" 
            android:textColor="@android:color/white" 
            android:textSize="20sp" 
            android:layout_gravity="center_horizontal" 
            android:padding="5dp" 
            android:gravity="center_horizontal" /> 
          </android.support.v7.widget.CardView> 


         </LinearLayout> 

         <LinearLayout 
          android:layout_width="match_parent" 
          android:layout_height="match_parent" 
          android:orientation="vertical"> 

          <android.support.v7.widget.CardView 
           android:layout_width="match_parent" 
           android:layout_height="match_parent" 
           app:cardBackgroundColor="@color/cardBg" 
           app:cardCornerRadius="0dp" 
           android:padding="0dp"> 

           <LinearLayout 
            android:layout_width="match_parent" 
            android:layout_height="match_parent" 
            android:orientation="vertical" 
            android:padding="15dp"> 
            <EditText 
             android:id="@+id/email" 
             android:layout_width="match_parent" 
             android:layout_height="wrap_content" 
             android:hint="Email here" 
             android:maxLines="1" 
             android:singleLine="true" /> 

            <EditText 
             android:id="@+id/password" 
             android:layout_width="match_parent" 
             android:layout_height="wrap_content" 
             android:hint="Password" 
             android:imeActionLabel="Password here" 
             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="wrap_content" 
             android:layout_height="wrap_content" 
             android:layout_marginTop="16dp" 
             android:text="Sign-in" 
             android:textStyle="bold" 
             android:elevation="5dp" 
             android:textColor="@color/colorPrimaryDark" 
             android:background="@android:color/white" 
             android:layout_gravity="center_horizontal" /> 
           </LinearLayout> 

          </android.support.v7.widget.CardView> 
         </LinearLayout> 
        </LinearLayout> 


       </android.support.v7.widget.CardView> 

      </LinearLayout> 

     </ScrollView> 

      <include layout="@layout/footer" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_alignParentBottom="true"> 
      </include> 

    </RelativeLayout> 

</android.support.design.widget.CoordinatorLayout> 

答えて

0

それはあなたのフッターが

wrap_content 

の高さの値と他の部分/ sの(ものは圧縮されている)

match_parent 

の価値を持っているを持っているためであり、それは持っていない場合特定の値またはwrap_contentは、キーボードを収容するために圧縮されます!

0

または、これはscrollViewで使用できます。これは私の問題を解決しました。

android:windowSoftInputMode="stateVisible|adjustPan" 
関連する問題