2017-04-07 12 views
0

ListViewには各行にEditTextがあり、footerview内にはすべてのコントロールが設定時にScrollViewの中にあります。android:windowSoftInputMode = "adjustPan" softkeyboardが開いているときに私のフッタービューをスクロールせず、また私の活動のヘッダーを押し上げようとしています。アンドロイド:windowSoftInputMode = "adjustResize"フッタビューフォームをスクロールしますが、私のリストビューを自動スクロールすると、アイテムが開いてEditTextフォーカスが失われても、私のヘッダーは上に移動しません。 申し訳ありませんが、私は説明がうまくいきませんが、私は説明したいことを下見したいと思います。実際に私はfooterviewの特定のレイアウトにscrollviewをスクロールしたいので、私はこれらの問題に直面して誰かが私を助けることができますか? があなたをここに各行のEditTextのリストビュー、リストビューのFooterView内のScrollview、adjustResizeとadjustPanすべての作業toughter

enter image description hereは私のフラグメントのXMLファイルですありがとうここ

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/application_background"> 
    <ListView 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:id="@+id/card_list" 
     android:fadingEdgeLength="0dp" 
     android:scrollbars="none" 
     android:headerDividersEnabled="false" 
     android:descendantFocusability="afterDescendants" 
     android:focusable="true" 
     android:focusableInTouchMode="true" 
     android:listSelector="@android:color/transparent" 
     android:footerDividersEnabled="false" 
     android:transcriptMode="alwaysScroll" /> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom" 
     android:orientation="horizontal" 
     android:id="@+id/ll_footer" 
     android:gravity="center" 
     android:background="@color/colorIndicatorFill"> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Pay 250" 
      android:textColor="@color/white" 
      android:id="@+id/txt_pay" 
      android:gravity="center" 
      android:textSize="@dimen/fontsize_txtview_18" /> 
    </LinearLayout> 
</LinearLayout> 

は、リストビューの私のfooterViewのxmlです

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:fillViewport="true" 
    android:isScrollContainer="true" 
    android:id="@+id/scrollView"> 
    <LinearLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/ll_footer_card" 
     android:padding="10dp"> 
     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_centerVertical="true" 
      android:orientation="horizontal" 
      android:id="@+id/rl_or"> 
      <TextView 
       android:id="@+id/txt_or" 
       android:textSize="@dimen/fontsize_txtview_16" 
       android:singleLine="true" 
       android:text="@string/or" 
       android:gravity="center" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:textColor="@color/colorActiveIndicator"/> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_1" 
       android:layout_centerVertical="true" 
       android:paddingLeft="@dimen/size_10" 
       android:layout_toLeftOf="@id/txt_or" 
       android:background="@color/gray_light" /> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_1" 
       android:layout_centerVertical="true" 
       android:paddingRight="@dimen/size_10" 
       android:layout_toRightOf="@id/txt_or" 
       android:background="@color/gray_light" /> 
     </RelativeLayout> 
     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:id="@+id/ll_choose_other_card"> 
      <TextView 
       android:layout_width="0dp" 
       android:layout_weight="0.9" 
       android:layout_height="wrap_content" 
       android:text="@string/choose_other_card" 
       android:id="@+id/txt_add_new_card" 
       android:textSize="@dimen/fontsize_txtview_16" 
       android:textColor="@color/colorActiveIndicator"/> 
      <RadioButton 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/radio_add_new_crad" 
       style="@style/RadioButton" /> 
     </LinearLayout> 
     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:id="@+id/ll_card_detail_form"> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <LinearLayout 
       android:layout_width="wrap_content" 
       android:gravity="center" 
       android:layout_gravity="center" 
       android:id="@+id/ll_scan_card" 
       android:layout_height="wrap_content" 
       android:background="@drawable/round_corner_light_green"> 
       <ImageView 
        android:layout_width="40dp" 
        android:layout_height="40dp" 
        android:src="@drawable/cards" 
        android:id="@+id/iv_card" 
        android:scaleType="centerInside"/> 
       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/scan_card" 
        android:textSize="@dimen/fontsize_txtview_16" 
        android:textColor="@color/color_white" 
        android:id="@+id/txt_scan_card"/> 
      </LinearLayout> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <View 
       android:layout_width="@dimen/size_300" 
       android:layout_gravity="center" 
       style="@style/DividerBottomLine"/> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <EditText 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/edt_card_number" 
       android:hint="@string/hint_card_number" 
       android:singleLine="true" 
       android:digits=" 1234567890" 
       android:inputType="number" 
       android:maxLength="23" 
       android:textColor="@color/text_color" 
       android:textColorHint="@color/hint_color" 
       android:textSize="@dimen/fontsize_edttext" 
       android:background="@drawable/edt_background" /> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/edt_expiry" 
       android:hint="@string/hint_expiry" 
       android:singleLine="true" 
       android:inputType="none" 
       android:imeOptions="actionNext" 
       android:textColor="@color/text_color" 
       android:textColorHint="@color/hint_color" 
       android:textSize="@dimen/fontsize_edttext" 
       android:background="@drawable/edt_background" /> 
      <net.cachapa.expandablelayout.ExpandableLayout 
       android:id="@+id/expandable_layout" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       app:el_duration="500" 
       app:el_expanded="false"> 
       <LinearLayout android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        android:gravity="center" 
        android:id="@+id/ll_datePicker" 
        android:animateLayoutChanges="true" 
        android:orientation="vertical"> 
        <LinearLayout 
         android:id="@+id/main_layout" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:background="@color/application_background" 
         android:orientation="vertical" > 
         <LinearLayout 
          android:id="@+id/layout_choose" 
          android:layout_width="match_parent" 
          android:layout_height="wrap_content" 
          android:gravity="center" 
          android:orientation="horizontal" > 
          <kankan.wheel.widget.WheelView 
           android:id="@+id/wheel_month" 
           android:layout_width="0dp" 
           android:layout_weight="0.5" 
           android:background="@color/white" 
           android:layout_height="wrap_content" /> 
          <kankan.wheel.widget.WheelView 
           android:id="@+id/wheel_year" 
           android:layout_width="0dp" 
           android:layout_weight="0.5" 
           android:background="@color/white" 
           android:layout_height="wrap_content" /> 
         </LinearLayout> 
         <widget.RippleView 
          android:id="@+id/ripple_confirm" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_gravity="center" 
          android:gravity="center" 
          app:rv_centered="true" 
          app:rv_color="@color/white" 
          app:rv_type="simpleRipple" > 
          <TextView 
           android:id="@+id/txt_confirm" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:gravity="center" 
           android:background="@drawable/round_corner_light_green" 
           android:text="@string/btn_Done" 
           android:textColor="@color/color_white" 
           android:textSize="@dimen/fontsize_txtview_18" /> 
         </widget.RippleView> 
        </LinearLayout> 

       </LinearLayout> 
      </net.cachapa.expandablelayout.ExpandableLayout> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <EditText 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/edt_cvv" 
       android:hint="@string/hint_cvv" 
       android:singleLine="true" 
       android:imeOptions="actionNext" 
       android:inputType="number" 
       android:maxLength="4" 
       android:textColor="@color/text_color" 
       android:textColorHint="@color/hint_color" 
       android:textSize="@dimen/fontsize_edttext" 
       android:background="@drawable/edt_background" /> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <EditText 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/edt_name_on_card" 
       android:hint="@string/hint_name_on_card" 
       android:singleLine="true" 
       android:maxLength="100" 
       android:textColor="@color/text_color" 
       android:textColorHint="@color/hint_color" 
       android:textSize="@dimen/fontsize_edttext" 
       android:imeOptions="actionDone" 
       android:background="@drawable/edt_background" /> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
      <CheckBox 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:id="@+id/chk_save_card" 
       android:textColor="@color/text_color" 
       style="@style/Checkbox" 
       android:textSize="@dimen/fontsize_edttext" 
       android:text="@string/save_card" /> 
      <View 
       android:layout_width="match_parent" 
       android:layout_height="@dimen/size_10"/> 
     </LinearLayout> 
    </LinearLayout> 
</ScrollView> 
+0

いくつかのコードを共有してください! –

+0

質問に句読点を使用してください。それは不明です。 –

+0

いくつかのスクリーンショットを追加してください。 –

答えて

0

あなたはscrollviewを除去することで試すことができますフッターから追加してthに追加するeフラグメントを作成し、ListViewの代わりにNonScrollableListViewを使用することができます。

Non-scrollable ListView inside ScrollView

PS:これを使用NonScrollableListViewを使用する方法の詳細については、参照

は、リストビューのためにあなたのアダプタ内部ViewHoldersを使用している願っています。

乾杯!

関連する問題