2017-12-07 6 views
0

をスクロールしていない私のscrollView XMLの私の活動のSoftInputModeではScrollviewここでのAndroid(AdjustPan)で

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

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 


    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="@drawable/gradient_toolbar" 
     android:clickable="true" 
     android:orientation="vertical"> 

     <ImageView 
      android:id="@+id/u_back_action" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_centerVertical="true" 
      android:layout_marginLeft="8dp" 
      android:padding="4dp" 
      android:src="@mipmap/arrow_back_blue" /> 


     <TextView 
      android:id="@+id/headerTextView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:text="@string/u_my_page" 
      android:textColor="#ffffff" 
      android:textSize="16dp" /> 

     <TextView 
      android:id="@+id/my_profile_edit" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="true" 
      android:layout_marginRight="8dp" 
      android:gravity="center" 
      android:padding="8dp" 

      android:singleLine="true" 
      android:text="@string/u_save" 
      android:textColor="#ffffff" 
      android:textSize="14dp" 
      android:visibility="gone" /> 


    </RelativeLayout> 


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


<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginLeft="16dp" 
     android:layout_marginRight="16dp" 
     android:orientation="vertical" 

     > 


     <LinearLayout 
      android:id="@+id/user_header_layout" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="25dp" 
      android:gravity="center_vertical" 
      android:orientation="vertical"> 



      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center" 
       android:layout_marginLeft="16dp" 
       android:layout_marginRight="16dp" 
       android:layout_marginTop="10dp" 
       android:orientation="vertical"> 

       <TextView 
        android:id="@+id/u_user_fullname" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:gravity="center" 
        android:maxLines="1" 
        android:singleLine="true" 
        android:textColor="#4d4d4d" 
        android:textSize="@dimen/u_common_text_size" 

        /> 
      </LinearLayout> 


     </LinearLayout> 


     <ScrollView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:fillViewport="true"> 


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

       <TextView 
        android:id="@+id/personal_settings" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerInParent="true" 
        android:layout_marginTop="30dp" 
        android:text="@string/u_personal_settings_txt" 
        android:textColor="#4d4d4d" 
        android:textSize="16dp" /> 

       <View 
        android:layout_width="match_parent" 
        android:layout_height="1dp" 
        android:background="#cccccc" /> 


       <android.support.design.widget.TextInputLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_marginTop="16dp" 
        android:background="@drawable/selector_edittext_action" 
        android:textColor="#4d4d4d" 

        android:textColorHint="#b3b3b3"> 

        <android.support.design.widget.TextInputEditText 
         android:id="@+id/first_name_lat" 
         android:layout_width="match_parent" 
         android:layout_height="48dp" 
         android:background="@null" 
         android:hint="@string/u_first_name_lat" 
         android:imeOptions="actionNext" 

         android:inputType="textNoSuggestions" 
         android:textColor="#4d4d4d" 

         android:textColorHint="#b3b3b3" 
         android:textCursorDrawable="@null" 
         android:textSize="16dp" 
         app:backgroundTint="@android:color/white" /> 
       </android.support.design.widget.TextInputLayout> 


       <android.support.design.widget.TextInputLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_marginTop="16dp" 
        android:background="@drawable/selector_edittext_action" 
        android:textColor="#4d4d4d" 

        android:textColorHint="#b3b3b3"> 

        <android.support.design.widget.TextInputEditText 
         android:id="@+id/last_name_lat" 
         android:layout_width="match_parent" 
         android:layout_height="48dp" 
         android:background="@null" 
         android:hint="@string/u_last_name_lat" 
         android:imeOptions="actionNext" 

         android:inputType="textNoSuggestions" 
         android:textColor="#4d4d4d" 

         android:textColorHint="#b3b3b3" 
         android:textCursorDrawable="@null" 
         android:textSize="16dp" 
         app:backgroundTint="@android:color/white" /> 
       </android.support.design.widget.TextInputLayout> 


       <android.support.design.widget.TextInputLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_marginTop="16dp" 
        android:background="@drawable/selector_edittext_action" 
        android:textColor="#4d4d4d" 

        android:textColorHint="#b3b3b3"> 

        <android.support.design.widget.TextInputEditText 
         android:id="@+id/u_address" 
         android:layout_width="match_parent" 
         android:layout_height="48dp" 
         android:background="@null" 
         android:hint="@string/u_address" 
         android:imeOptions="actionNext" 

         android:inputType="textNoSuggestions" 
         android:textColor="#4d4d4d" 

         android:textColorHint="#b3b3b3" 
         android:textCursorDrawable="@null" 
         android:textSize="16dp" 
         app:backgroundTint="@android:color/white" /> 
       </android.support.design.widget.TextInputLayout> 


       <android.support.design.widget.TextInputLayout 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:layout_marginTop="16dp" 
        android:background="@drawable/selector_edittext_action" 
        android:textColor="#4d4d4d" 

        android:textColorHint="#b3b3b3"> 

        <android.support.design.widget.TextInputEditText 
         android:id="@+id/u_gender" 
         android:layout_width="match_parent" 
         android:layout_height="48dp" 
         android:background="@null" 
         android:hint="@string/u_gender" 
         android:imeOptions="actionNext" 

         android:inputType="textNoSuggestions" 
         android:textColor="#4d4d4d" 

         android:textColorHint="#b3b3b3" 
         android:textCursorDrawable="@null" 
         android:textSize="16dp" 
         app:backgroundTint="@android:color/white" /> 
       </android.support.design.widget.TextInputLayout> 


      </LinearLayout> 

     </ScrollView> 
    </LinearLayout> 

</android.support.v4.widget.NestedScrollView> 

がadjustNothingされています。

私のスクロールビューは機能していないと言いました。私の問題について検索しましたが、解決策の1つはadjustResizeですが、私のAppBarLayoutレイアウトが上がっているので、

私の質問は、現時点ではscrollviewを動かすことができるということです(adjustNothing)。キーボードが表示されているときに私の最後の編集テキストを表示することはできません。 または、adjustResizeまたはadjustPanを使用すると、xmlのAppBarLayoutレイアウトを無効にすることはできますか? おかげでみんな

答えて

0

ここでは、ソリューション

がNestedScrollViewの子レイアウト

android:descendantFocusability="afterDescendants" 

とマニフェストファイル

android:windowSoftInputMode="adjustResize" 
に次の行を追加しています
関連する問題