0

私はロゴ画像のビューとタイトルが上部に約80 dpの高さを持つスクリーンを設計しました。その後、フレームレイアウトはその横に縦に保持されます。フレームレイアウトは、フラグメントを動的にロードします。このフラグメントは、入力フィールドを含むスクロールビューを保持します。この問題はここでは、テキストの編集に焦点を合わせると、画面全体がスクロールアップします。フラグメント内のスクロールビューだけをスクロールしたい上部の領域は固定する必要があります。ホルダーアクティビティとその断片のレイアウト設計を行ってください。 私は、スクロールビューだけをキーボードの上に収縮させたいです。私は非常に新しいアンドロイド開発に誰もが私を助けることができます。Androidスクロールの問題

HolderActivityレイアウト

<?xml version="1.0" encoding="utf-8"?> 

<ImageView 
    android:id="@+id/patternImageView" 
    style="@style/WFImageViewPatternBG"/> 

<ImageView 
    android:id="@+id/titleImageView" 
    style="@style/WFImageViewTitle" 
    android:layout_centerHorizontal="true"/> 

<TextView 
    android:id="@+id/fertilityTextView" 
    style="@style/WFTextStyleFertilityTitle" 
    android:layout_below="@id/titleImageView" 
    /> 

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/fragmentPlaceholder" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_below="@id/fertilityTextView" 
    android:layout_marginTop="20dp"> 

    <!-- Fragment will go here eventually, but it's not added in the layout --> 

</FrameLayout> 

フラグメントアクティビティレイアウト

<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" 
tools:context="com.ideasurge.winfertility.CreateAccountInputFragment"> 

<ScrollView 
    android:id="@+id/inputScrollView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_above="@+id/createAcctNextBtn"> 

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

     <TextView 
      android:id="@+id/createAcctTitleTextView" 
      style="@style/WFTextStyleBoldPinkTitle" 
      android:text="Create An Account" /> 

     <EditText 
      android:id="@+id/first_name_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="First Name" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_marginTop="20dp" 
      android:layout_below="@+id/createAcctTitleTextView" /> 

     <EditText 
      android:id="@+id/last_name_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Last Name" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/first_name_edit_txt" /> 

     <EditText 
      android:id="@+id/email_pwd_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Email Address" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/last_name_edit_txt" /> 

     <EditText 
      android:id="@+id/phone_no_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Phone Number" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/email_pwd_edit_txt" /> 

     <EditText 
      android:id="@+id/create_pwd_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Create Password" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/phone_no_edit_txt" /> 

     <EditText 
      android:id="@+id/dob_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Date of Birth" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/create_pwd_edit_txt" /> 

     <EditText 
      android:id="@+id/gender_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Gender" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/dob_edit_txt" /> 

     <TextView 
      android:id="@+id/companySectionTitle" 
      style="@style/WFTextStyleSectionPinkTitle" 
      android:text="Your company may provide Fertility Benefits." 
      android:layout_marginLeft="40dp" 
      android:layout_marginRight="40dp" 
      android:layout_marginTop="10dp" 
      android:layout_marginBottom="20dp" 
      android:layout_below="@+id/gender_edit_txt"/> 

     <EditText 
      android:id="@+id/company_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Name of Company" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/companySectionTitle" /> 

     <EditText 
      android:id="@+id/insurance_id_edit_txt" 
      style="@style/WFEditTextStyle" 
      android:hint="Insurance Subscriber ID" 
      android:background="@drawable/rounded_border_pink" 
      android:layout_below="@+id/company_edit_txt" /> 

    </RelativeLayout> 

</ScrollView> 

<Button 
    android:id="@+id/createAcctNextBtn" 
    style="@style/WFButtonStylePink" 
    android:text="NEXT" 
    android:layout_marginTop="20dp" 
    android:layout_marginBottom="20dp" 
    android:layout_alignParentBottom="true" 
    /> 

答えて

0

これは役立つかもしれない:あなたの代わりにadjustpanの他のオプションを使用することができます。ここ

<activity 
    android:name=".Activity" 
    android:windowSoftInputMode="adjustPan" /> 

android:windowSoftInputMode="adjustPan" 

は次のようにマニフェストアクティビティタグで使用してください。